mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Bootstrap/Load: Make sure add_magic_quotes() does not inappropriately recast non-string data types to string.
Props donmhico, jrf, Veraxus, Rarst. Fixes #48605. git-svn-id: https://develop.svn.wordpress.org/trunk@48205 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1219,6 +1219,7 @@ function wp_removable_query_args() {
|
||||
* Walks the array while sanitizing the contents.
|
||||
*
|
||||
* @since 0.71
|
||||
* @since 5.5.0 Non-string values are left untouched.
|
||||
*
|
||||
* @param array $array Array to walk while sanitizing contents.
|
||||
* @return array Sanitized $array.
|
||||
@@ -1227,10 +1228,13 @@ function add_magic_quotes( $array ) {
|
||||
foreach ( (array) $array as $k => $v ) {
|
||||
if ( is_array( $v ) ) {
|
||||
$array[ $k ] = add_magic_quotes( $v );
|
||||
} elseif ( ! is_string( $v ) ) {
|
||||
continue;
|
||||
} else {
|
||||
$array[ $k ] = addslashes( $v );
|
||||
}
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user