Skip to content

Commit

Permalink
Improve clarity and speed of [25320] (merged as [25325]). Merges [253…
Browse files Browse the repository at this point in the history
…38] 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
  • Loading branch information
nacin committed Sep 11, 2013
1 parent 5ea0b8a commit a2b1caa
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions wp-includes/functions.php
Expand Up @@ -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];
Expand Down

0 comments on commit a2b1caa

Please sign in to comment.