[wp-trac] [WordPress Trac] #29660: Functions in wp_includes/query.php assume non-null return value from get_queried_object

WordPress Trac noreply at wordpress.org
Sat May 2 10:34:17 UTC 2015


#29660: Functions in wp_includes/query.php assume non-null return value from
get_queried_object
-------------------------------+------------------------------
 Reporter:  yellyc             |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Query              |     Version:  4.0
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by darkskipper):

 In the mean time, here's a little "band-aid" I'm using...

 {{{
 #!php
 remove_action ('template_redirect', 'redirect_canonical',   10);
 add_action    ('template_redirect', 'actRedirectCanonical', 10);

 function actRedirectCanonical ()
 {
     @redirect_canonical (); // Quietly
 }
 }}}

 To make the above code theme-agnostic, it can be placed in a must-use
 plug-in. Otherwise it can just go in a theme's `functions.php` file.

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


More information about the wp-trac mailing list