Attempt to make stripslashes_deep object safe. See #12860
git-svn-id: https://develop.svn.wordpress.org/trunk@14766 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1356037d95
commit
82a44c5a3b
@ -1226,7 +1226,17 @@ function addslashes_gpc($gpc) {
|
||||
* @return array|string Stripped array (or string in the callback).
|
||||
*/
|
||||
function stripslashes_deep($value) {
|
||||
$value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
|
||||
if ( is_array($value) ) {
|
||||
$value = array_map('stripslashes_deep', $value);
|
||||
} elseif ( is_object($value) ) {
|
||||
$vars = get_object_vars( $value );
|
||||
foreach ($vars as $key=>$data) {
|
||||
$value->{$key} = stripslashes_deep( $data );
|
||||
}
|
||||
} else {
|
||||
$value = stripslashes($value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user