[wp-trac] [WordPress Trac] #18488: set_transient crashes when value parameter is a SimpleXMLElement object

WordPress Trac wp-trac at lists.automattic.com
Sat Aug 20 03:56:35 UTC 2011


#18488: set_transient crashes when value parameter is a SimpleXMLElement object
--------------------------+------------------------------
 Reporter:  bobbingwide   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Cache         |     Version:  3.2.1
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by dd32):

 I'm pretty sure you'll find you can't serialize SimpleXML objects (And
 therefor, can't store in a Object Cache which WordPress uses)

 The method you'd use to store an element would be to convert it to XML (It
 has a toXML() method IIRC) and create the new object afterwards from that
 xml. However, I don't think you can pull a node out of a SimpleXML object
 either reliably, as child nodes need the context of the parents too.

 I'm not sure there's anything we can do here myself?

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


More information about the wp-trac mailing list