From e8b8361ffe827b22ebbd3b136e67a7ecf454f3c9 Mon Sep 17 00:00:00 2001 From: westi Date: Thu, 20 May 2010 21:16:44 +0000 Subject: [PATCH] Attempt to make stripslashes_deep object safe. See #12860 git-svn-id: http://svn.automattic.com/wordpress/trunk@14766 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; }