From 8b7967db381a5f66bdc1d6060e31cec492d8630d Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Fri, 26 Oct 2018 20:18:38 +0000 Subject: [PATCH] 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 --- wp-includes/class-wp-network-query.php | 3 +++ wp-includes/class-wp-site-query.php | 3 +++ wp-includes/version.php | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-network-query.php b/wp-includes/class-wp-network-query.php index f8ca48f452..2b59e8a93b 100644 --- a/wp-includes/class-wp-network-query.php +++ b/wp-includes/class-wp-network-query.php @@ -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' ); /** diff --git a/wp-includes/class-wp-site-query.php b/wp-includes/class-wp-site-query.php index cf2134d8a4..78fc59f58e 100644 --- a/wp-includes/class-wp-site-query.php +++ b/wp-includes/class-wp-site-query.php @@ -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' ); /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 3a63e68a99..c00a71bbdf 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.