[wp-trac] [WordPress Trac] #37738: WP_Post::get_instance returns erroneous data for invalid input such as an array or object instead of false.

WordPress Trac noreply at wordpress.org
Fri Aug 26 19:08:24 UTC 2016


#37738: WP_Post::get_instance returns erroneous data for invalid input such as an
array or object instead of false.
--------------------------------------+---------------------------
 Reporter:  deeptiboddapati           |       Owner:  boonebgorges
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  4.7
Component:  Posts, Post Types         |     Version:  3.5
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------------
Changes (by boonebgorges):

 * owner:   => boonebgorges
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"38381"]:
 {{{
 #!CommitTicketReference repository="" revision="38381"
 Don't improperly cast IDs when fetching post, user, or term objects.

 Blindly casting passed IDs to integers can generate false positives
 when the ID is cast to `1`.

 Props deeptiboddapati.
 Fixes #37738.
 }}}

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


More information about the wp-trac mailing list