[wp-trac] Re: [WordPress Trac] #9663: is_serialized() should be renamed to might_be_serialized();

WordPress Trac wp-trac at lists.automattic.com
Tue May 26 10:26:29 GMT 2009


#9663: is_serialized() should be renamed to might_be_serialized();
--------------------------+-------------------------------------------------
 Reporter:  hakre         |       Owner:  anonymous     
     Type:  defect (bug)  |      Status:  new           
 Priority:  normal        |   Milestone:  Future Release
Component:  Charset       |     Version:  2.7.1         
 Severity:  normal        |    Keywords:                
--------------------------+-------------------------------------------------

Comment(by vladimir_kolesnikov):

 Replying to [comment:3 Denis-de-Bernardy]:
 > serialize()/unserialize() isn't, however.

 Why?

   * integers/floats/booleans are multibyte safe by definition.
   * strings are prefixed with length: s:3:"hi!", so it does not matter
 what is inside the string since we know its size in bytes (+2 for
 surrounding quotes).
   * objects have their names prefixed with length (say,
 O:8:"stdClass":...); as a consequence, they are also multibyte safe;
   * arrays/object properties consist of integers/floats/booleans/strings
 (which are mb-safe); thus, arrays and objects are mb-safe as well.

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


More information about the wp-trac mailing list