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.


Built from https://develop.svn.wordpress.org/branches/5.0@43832


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Aaron Jorbin 2018-10-26 20:18:38 +00:00
parent 97a88cdf69
commit 8b7967db38
3 changed files with 7 additions and 1 deletions

View File

@ -328,6 +328,7 @@ class WP_Network_Query {
$number = absint( $this->query_vars['number'] );
$offset = absint( $this->query_vars['offset'] );
$limits = '';
if ( ! empty( $number ) ) {
if ( $offset ) {
@ -393,6 +394,8 @@ class WP_Network_Query {
$where = implode( ' AND ', $this->sql_clauses['where'] );
$groupby = '';
$pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
/**

View File

@ -372,6 +372,7 @@ class WP_Site_Query {
$number = absint( $this->query_vars['number'] );
$offset = absint( $this->query_vars['offset'] );
$limits = '';
if ( ! empty( $number ) ) {
if ( $offset ) {
@ -525,6 +526,8 @@ class WP_Site_Query {
$where = implode( ' AND ', $this->sql_clauses['where'] );
$groupby = '';
$pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
/**

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-beta1-43831';
$wp_version = '5.0-beta1-43832';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.