From 4975bf8ed8302bb3829e1f206cf8c25c466e9e9c Mon Sep 17 00:00:00 2001 From: nacin Date: Sun, 11 Apr 2010 17:07:20 +0000 Subject: [PATCH] Revert changes to maybe_serialize() made in r13673. Do not prevent double-serialization of data. see #12930. see also #12416. xref #7347, r8100, r8372, and others. git-svn-id: http://svn.automattic.com/wordpress/trunk@14074 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 178cc6675..205a442f5 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1008,7 +1008,10 @@ function delete_all_user_settings() { * @return mixed A scalar data */ function maybe_serialize( $data ) { - if ( !is_scalar( $data ) ) + if ( is_array( $data ) || is_object( $data ) ) + return serialize( $data ); + + if ( is_serialized( $data ) ) return serialize( $data ); return $data;