[wp-trac] [WordPress Trac] #16504: Faster maybe_unserialize

WordPress Trac wp-trac at lists.automattic.com
Wed Feb 9 12:44:35 UTC 2011


#16504: Faster maybe_unserialize
-------------------------+------------------------------
 Reporter:  hakre        |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:  3.1
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------------------

Comment (by westi):

 Replying to [comment:5 hakre]:
 > Replying to [comment:4 westi]:
 > > Replying to [comment:3 hakre]:
 > > >   Option values, if serialized are only serialized Array, Objects or
 Strings. No exceptions. [...]
 > > No it's not - what about serialized integers?
 >
 > I've created a table in my post [http://hakre.wordpress.com/2011/02/09
 /serialization-in-options-cant-see-the-wood-for-the-trees/ Serialization
 in Options: Cant see the Wood for the Trees] that handles each data case
 and tells whether it is serialized in options or not. It's the first
 table.
 >
 > The "Option Values" I talk about are those that come from the database,
 not those that are returned by `get_option()`. That function will always
 return the unserialized value, in case of your serialized integer, the
 serialized integer.
 >
 > If you look into the code of the patch, it becomes clear about what
 functions this is about.
 >
 > Does this helps to better understand?

 Not really.

 You are still making an assumption: You are assuming that the only place
 maybe_unserialize is ever used is for unserializing things which have been
 maybe_serialized - you are changing it's behaviour by not supporting all
 types of serialized data.

 It has had this behaviour since WordPress 2.0 - we are not going to break
 it!

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


More information about the wp-trac mailing list