[wp-trac] [WordPress Trac] #16597: Bug in the maybe_serialize() function - it serializing also serailize objects.

WordPress Trac wp-trac at lists.automattic.com
Sat Feb 19 18:53:47 UTC 2011


#16597: Bug in the maybe_serialize() function - it serializing also serailize
objects.
--------------------------+------------------------------
 Reporter:  maorb         |       Owner:  nacin
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Formatting    |     Version:  3.0.5
 Severity:  major         |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by nacin):

 If you serialize something then pass it to add_metadata(), then you should
 be expected to unserialize it when you fetch it from get_metadata().
 Whatever goes in, comes out.

 In turn, the functions already serialize -- that's the point of
 maybe_serialize(), it gets used in the transient, option, site option, and
 metadata APIs. Just pass an array or object and it'll take care of it. In
 a nutshell, you're thinking too hard. :-)

 When this last came up, I wrote a blog post on it:
 http://andrewnacin.com/2010/04/18/wordpress-serializing-data/.

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


More information about the wp-trac mailing list