Make WordPress Core


Ignore:
Timestamp:
09/12/2015 03:36:12 AM (9 years ago)
Author:
boonebgorges
Message:

Better default values in WP_Query::get_queried_object().

Setting the default value of the queried_object_id property to 0 meant
that, when called early enough in the WP bootstrap, get_queried_object()
could short-circuit the normal query by fooling it into thinking that the
request was for a page with id 0. Setting the default value to null instead
avoids this problem.

Props gradyetc, jazbek.
Fixes #31355.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/query.php

    r33963 r34073  
    39273927
    39283928        $this->queried_object = null;
    3929         $this->queried_object_id = 0;
     3929        $this->queried_object_id = null;
    39303930
    39313931        if ( $this->is_category || $this->is_tag || $this->is_tax ) {
Note: See TracChangeset for help on using the changeset viewer.