[wp-trac] [WordPress Trac] #42069: Saving metadata fails (randomly) if equal value already exists

WordPress Trac noreply at wordpress.org
Wed May 23 12:33:06 UTC 2018


#42069: Saving metadata fails (randomly) if equal value already exists
--------------------------+------------------------------
 Reporter:  JVel          |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  REST API      |     Version:  4.8.2
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  rest-api
--------------------------+------------------------------

Comment (by dcavins):

 Replying to [comment:4 MattGeri]:
 Thanks for your comments. Your change is close to what TimothyBlynJacobs
 suggested in
 https://core.trac.wordpress.org/attachment/ticket/42810/42810.diff

 Can you offer a use case that fails in his previous patch, so that we can
 explain the necessity of adding `wp_unslash()`?

 I'm fuzzy on the details, but it seems like one of my test cases was
 failing with the previous patch, probably the `'0' (from saved meta) === 0
 (incoming sanitized POST) case`, which is why I added the sanitize step to
 the saved value as well. It's easy to test, but hard to remember something
 from a few months ago.

 Thanks!

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


More information about the wp-trac mailing list