diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 8710b7159c..eebaace2d1 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -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; }