Make WordPress Core


Ignore:
Timestamp:
10/26/2018 08:16:22 PM (8 years ago)
Author:
jorbin
Message:

php7.3 compatibility: Fix compact throwing notices for multisite

In PHP 7.3, the compact() function has been changed to issue an E_NOTICE level error if a passed string refers to an unset variable. In previous versions of PHP, this notice was silently skipped. The full RFC can be viewed here: https://wiki.php.net/rfc/compact

By initializing these variables, they can be compacted.

Previously [43819].
See #44416.
Props desrosj.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-includes/class-wp-network-query.php

    r41918 r43832  
    329329        $number = absint( $this->query_vars['number'] );
    330330        $offset = absint( $this->query_vars['offset'] );
     331        $limits = '';
    331332
    332333        if ( ! empty( $number ) ) {
     
    393394
    394395        $where = implode( ' AND ', $this->sql_clauses['where'] );
     396
     397        $groupby = '';
    395398
    396399        $pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
Note: See TracChangeset for help on using the changeset viewer.