[wp-trac] [WordPress Trac] #56832: update_post_meta / get_post_meta data corruption in serialization

WordPress Trac noreply at wordpress.org
Sat Oct 15 21:01:56 UTC 2022


#56832: update_post_meta / get_post_meta data corruption in serialization
--------------------------------+------------------------
 Reporter:  loopy255            |       Owner:  (none)
     Type:  defect (bug)        |      Status:  closed
 Priority:  normal              |   Milestone:
Component:  Options, Meta APIs  |     Version:
 Severity:  normal              |  Resolution:  duplicate
 Keywords:                      |     Focuses:
--------------------------------+------------------------
Changes (by TimothyBlynJacobs):

 * status:  new => closed
 * resolution:   => duplicate
 * milestone:  Awaiting Review =>


Comment:

 Hi @loopy255,

 Welcome to trac and thanks for the ticket!

 Unfortunately, the metadata APIs are one of the APIs that expect slashed
 data. If you're manually constructing a value passed to the metadata APIs
 from unslashed data, then you must call `wp_slash` before passing the
 value to the metadata APIs.

 This is documented inline to the function, but isn't explicitly mentioned
 in the function's PHP docs. See #41593.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56832#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list