WordPress.org

Make WordPress Core

Changeset 43832


Ignore:
Timestamp:
10/26/2018 08:16:22 PM (14 months 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.

Location:
branches/5.0/src/wp-includes
Files:
2 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' );
  • branches/5.0/src/wp-includes/class-wp-site-query.php

    r41912 r43832  
    373373        $number = absint( $this->query_vars['number'] );
    374374        $offset = absint( $this->query_vars['offset'] );
     375        $limits = '';
    375376
    376377        if ( ! empty( $number ) ) {
     
    525526
    526527        $where = implode( ' AND ', $this->sql_clauses['where'] );
     528
     529        $groupby = '';
    527530
    528531        $pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
Note: See TracChangeset for help on using the changeset viewer.