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
This commit is contained in:
nacin 2010-04-11 17:07:20 +00:00
parent ccb93ac4c7
commit 4975bf8ed8
1 changed files with 4 additions and 1 deletions

View File

@ -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;