Improve clarity and speed of [25320] (merged as [25325]). Merges [25338] to 3.6.
Built from https://develop.svn.wordpress.org/branches/3.6@25339 git-svn-id: http://core.svn.wordpress.org/branches/3.6@25301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5ea0b8ae86
commit
a2b1caaaee
|
@ -262,8 +262,15 @@ function is_serialized( $data, $strict = true ) {
|
|||
if ( ';' !== $lastc && '}' !== $lastc )
|
||||
return false;
|
||||
} else {
|
||||
// ensures ; or } exists but is not in the first X chars
|
||||
if ( strpos( $data, ';' ) < 3 && strpos( $data, '}' ) < 4 )
|
||||
$semicolon = strpos( $data, ';' );
|
||||
$brace = strpos( $data, '}' );
|
||||
// Either ; or } must exist.
|
||||
if ( false === $semicolon && false === $brace )
|
||||
return false;
|
||||
// But neither must be in the first X characters.
|
||||
if ( false !== $semicolon && $semicolon < 3 )
|
||||
return false;
|
||||
if ( false !== $brace && $brace < 4 )
|
||||
return false;
|
||||
}
|
||||
$token = $data[0];
|
||||
|
|
Loading…
Reference in New Issue