Make WordPress Core

Changeset 52804


Ignore:
Timestamp:
02/26/2022 02:26:21 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Query: Preinitialize the WP class properties to their default values.

This avoids an array_keys() expects parameter 1 to be array, null given PHP warning for the query_vars property in WP::build_query_string() when disabling request parsing via the do_parse_request filter.

Props dd32, SergeyBiryukov.
Fixes #55222.

File:
1 edited

Legend:

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

    r51622 r52804  
    4141     * @var array
    4242     */
    43     public $query_vars;
     43    public $query_vars = array();
    4444
    4545    /**
     
    4949     * @var string
    5050     */
    51     public $query_string;
     51    public $query_string = '';
    5252
    5353    /**
     
    5757     * @var string
    5858     */
    59     public $request;
     59    public $request = '';
    6060
    6161    /**
     
    6565     * @var string
    6666     */
    67     public $matched_rule;
     67    public $matched_rule = '';
    6868
    6969    /**
     
    7373     * @var string
    7474     */
    75     public $matched_query;
     75    public $matched_query = '';
    7676
    7777    /**
Note: See TracChangeset for help on using the changeset viewer.