[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 19 21:11:38 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:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Posts, Post Types         |     Version:  3.5
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------------

Comment (by deeptiboddapati):

 That ticket was really good to read. It helped me notice that the patch
 missed numeric strings such as '1' or '1.4'. In that ticket they used
 is_scalar but that returns true for 'apple' as well as '1'. I used
 is_numeric in this redone patch since it returns true for '1.36546' or '3'
 but not for '3rd' or 'apple'.

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


More information about the wp-trac mailing list