LLMS_Events::sanitize_raw_event( array $raw )
Recursively sanitize event data.
Parameters Parameters
- $raw
-
(array) (Required) Event information array.
Return Return
(array)
Source Source
File: includes/class-llms-events.php
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | protected function sanitize_raw_event( $raw ) { $clean = array (); foreach ( $raw as $key => $val ) { // This will recursively handle any metadata submitted. if ( is_array ( $val ) ) { $val = $this ->sanitize_raw_event( $val ); } elseif ( in_array( $key , array ( 'actor_id' , 'object_id' ), true ) ) { // cast id fields to int. $val = absint( $val ); } else { // everything else is a text field. $val = sanitize_text_field( $val ); } // Sanitize the key. This will ensure no dirty keys are submitted in metadata. $key = is_numeric ( $key ) ? $key : sanitize_text_field( $key ); $clean [ $key ] = $val ; } return $clean ; } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.36.0 | Introduced. |