[wp-trac] [WordPress Trac] #9930: is_serialized() returns false on serialized doubles

WordPress Trac wp-trac at lists.automattic.com
Tue Mar 2 19:41:26 UTC 2010


#9930: is_serialized() returns false on serialized doubles
-----------------------------------+----------------------------------------
 Reporter:  vladimir_kolesnikov    |        Owner:  westi   
     Type:  defect (bug)           |       Status:  reopened
 Priority:  normal                 |    Milestone:  3.0     
Component:  General                |      Version:          
 Severity:  minor                  |   Resolution:          
 Keywords:  has-patch 2nd-opinion  |  
-----------------------------------+----------------------------------------
Changes (by Denis-de-Bernardy):

  * keywords:  has-patch => has-patch 2nd-opinion


Comment:

 works, but do we really want to to introduce this amount of backtracking?

 array could just as well use:

 {{{
 preg_match( '/^a:[0-9]+:/', $data );
 }}}

 object could just as well use:

 {{{
 preg_match(
 '/^O:[0-9]+:"[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*":[0-9]+:', $data );
 }}}

 and the string case could use something like:

 {{{
 substr($data, -2, 2) == '";' && preg_match( '/^s:[0-9]+:"/', $data );
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9930#comment:30>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list