add_magic_quotes( array $input_array )
Walks the array while sanitizing the contents.
Parameters
- $input_array
-
(Required) Array to walk while sanitizing contents.
Return
(array) Sanitized $input_array.
Source
File: wp-includes/functions.php
function add_magic_quotes( $array ) {
foreach ( (array) $array as $k => $v ) {
if ( is_array( $v ) ) {
$array[$k] = add_magic_quotes( $v );
} else {
$array[$k] = addslashes( $v );
}
}
return $array;
}
Changelog
Version | Description |
---|---|
5.5.0 | Non-string values are left untouched. |
0.71 | Introduced. |