From 74cfa717cb710badeacfde9b95b54b4204231c7b Mon Sep 17 00:00:00 2001 From: Andrew 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: https://develop.svn.wordpress.org/trunk@14074 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 178cc66752..205a442f5e 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;