[wp-trac] [WordPress Trac] #24023: 3.5/wp-includes/functions.php : missing break statement
WordPress Trac
noreply at wordpress.org
Wed Apr 10 04:26:20 UTC 2013
#24023: 3.5/wp-includes/functions.php : missing break statement
--------------------------+-----------------------
Reporter: tivnet | Owner:
Type: defect (bug) | Status: reopened
Priority: normal | Milestone:
Component: General | Version: 3.5.1
Severity: trivial | Resolution:
Keywords: needs-patch |
--------------------------+-----------------------
Comment (by tivnet):
Replying to [comment:4 nacin]:
Just wrote a little test. Do not need to catch E_NOTICE.
{{{
error_reporting(E_ALL);
var_dump(_is_serialized('a'));
var_dump(_is_serialized(serialize('a')));
var_dump(_is_serialized(false));
var_dump(_is_serialized(serialize(false)));
var_dump(_is_serialized(true));
var_dump(_is_serialized(serialize(true)));
var_dump(_is_serialized(array(1,'2',3, true)));
var_dump(_is_serialized(serialize(array(1,'2',3, true))));
var_dump(_is_serialized(new stdClass()));
var_dump(_is_serialized(serialize(new stdClass())));
function _is_serialized($data) {
if(!is_string($data)){ // this is not required
return false;
}
if ($data === "b:0;") {
return true;
}
return (@unserialize($data) !== false);
}
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24023#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list