add_magic_quotes() – Walks the array while sanitizing the contents.

You appear to be a bot. Output may be restricted

Description

Walks the array while sanitizing the contents.

Usage

$array = add_magic_quotes( $input_array );

Parameters

$input_array
( array ) required – Array to walk while sanitizing contents.

Returns

array Sanitized $input_array.

Source

File name: wordpress/wp-includes/functions.php
Lines:

1 to 11 of 11
function add_magic_quotes( $input_array ) {
  foreach ( (array) $input_array as $k => $v ) {
    if ( is_array( $v ) ) {
      $input_array[ $k ] = add_magic_quotes( $v );
    } elseif ( is_string( $v ) ) {
      $input_array[ $k ] = addslashes( $v );
    }
  }

  return $input_array;
}
 

 View on GitHub View on Trac