[wp-trac] [WordPress Trac] #24674: WP_Query::is_page() should use stricter comparison

WordPress Trac noreply at wordpress.org
Tue Jul 2 15:35:52 UTC 2013


#24674: WP_Query::is_page() should use stricter comparison
--------------------------+------------------------------
 Reporter:  clifgriffin   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.5.2
 Severity:  minor         |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Comment (by nacin):

 The problem with strict mode is it would prevent a numeric string from
 being treated as an ID. I'm sure someone has passed in `'123'` instead of
 `int 123` to is_page() before.

 It is possible for $page_obj to be 0 if a plugin is trying to trick
 WP_Query. (Not recommended.)

 It would be best to simply return false under certain specific situations.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24674#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list