Return false for corrupted serialized strings. props Denis-de-Bernardy. fixes #9549

git-svn-id: https://develop.svn.wordpress.org/trunk@10955 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2009-04-16 21:03:18 +00:00
parent 99b5b3693b
commit 84b875a903
1 changed files with 1 additions and 2 deletions

View File

@ -226,8 +226,7 @@ function get_weekstartend( $mysqlstring, $start_of_week = '' ) {
*/
function maybe_unserialize( $original ) {
if ( is_serialized( $original ) ) // don't attempt to unserialize data that wasn't serialized going in
if ( false !== $gm = @unserialize( $original ) )
return $gm;
return @unserialize( $original );
return $original;
}