Make WordPress Core

Opened 6 weeks ago

Last modified 2 weeks ago

#47965 new defect (bug)

Missing strict comparison check in REST Autosaves Controller

Reported by: dkarfa Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: REST API Keywords: has-patch
Focuses: rest-api Cc:
PR Number:


Missing Yoda conditions check at wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php

Attachments (2)

47965.patch (1.4 KB) - added by dkarfa 6 weeks ago.
47965.1.diff (879 bytes) - added by itowhid06 2 weeks ago.

Download all attachments as: .zip

Change History (6)

6 weeks ago

#1 @dkarfa
6 weeks ago

  • Component changed from General to REST API

#2 @mukesh27
6 weeks ago

  • Focuses rest-api added
  • Keywords has-patch added

#3 @TimothyBlynJacobs
6 weeks ago

  • Summary changed from Missing Yoda Conditions check to Missing strict comparison check in REST Autosaves Controller

Thanks for the patch @dkarfa!

I'm a bit worried about the $post->post_author === $user_id check. In the type doc it is listed as a string and accompanied by "A numeric string, for compatibility reasons."

#4 @itowhid06
2 weeks ago

I completely agree with @TimothyBlynJacobs about $post->post_author === $user_id check. Also the patch doesn't apply properly and I've refreshed it. I hope @dkarfa is OK with it :)

2 weeks ago

Note: See TracTickets for help on using tickets.