From 81ae841eba80a705ab5799cf9ed360d747ce3a20 Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 20 Jul 2012 15:14:26 +0000 Subject: [PATCH] Only run stripslashes() in stripslashes_deep() for strings, not other scalar values. props Kawauso, knutsp. props coffee2code for [UT698]. fixes #18026. git-svn-id: http://core.svn.wordpress.org/trunk@21292 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index bc0ab7bf3f..a1c3f826c5 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -1380,8 +1380,8 @@ function addslashes_gpc($gpc) { * * @since 2.0.0 * - * @param array|string $value The array or string to be stripped. - * @return array|string Stripped array (or string in the callback). + * @param mixed $value The value to be stripped. + * @return mixed Stripped value. */ function stripslashes_deep($value) { if ( is_array($value) ) { @@ -1391,7 +1391,7 @@ function stripslashes_deep($value) { foreach ($vars as $key=>$data) { $value->{$key} = stripslashes_deep( $data ); } - } else { + } elseif ( is_string( $value ) ) { $value = stripslashes($value); }