From 15db4432507597502ab4f5ab843a120edc645305 Mon Sep 17 00:00:00 2001 From: desrosj Date: Sat, 15 Dec 2018 11:01:25 +0000 Subject: [PATCH] PHP 7.3 Compatibility: Fix compact related notices. 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. This fixes a few more instances of unset variables in the WordPress admin. The full RFC can be viewed here: https://wiki.php.net/rfc/compact. See #44416. Fixes #45483. Built from https://develop.svn.wordpress.org/branches/5.0@44185 git-svn-id: http://core.svn.wordpress.org/branches/5.0@44015 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/plugin-install.php | 1 + wp-admin/includes/post.php | 6 ++++++ wp-includes/version.php | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php index eea74f1aeb..8294a783f7 100644 --- a/wp-admin/includes/plugin-install.php +++ b/wp-admin/includes/plugin-install.php @@ -394,6 +394,7 @@ function install_plugin_install_status($api, $loop = false) { $status = 'install'; $url = false; $update_file = false; + $version = ''; /* * Check to see if this plugin is known to be installed, diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 667834a865..8eab849f4e 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -1029,18 +1029,24 @@ function wp_edit_posts_query( $q = false ) { $post_type = 'post'; $avail_post_stati = get_available_post_statuses($post_type); + $post_status = ''; + $perm = ''; if ( isset($q['post_status']) && in_array( $q['post_status'], $post_stati ) ) { $post_status = $q['post_status']; $perm = 'readable'; } + $orderby = ''; + if ( isset( $q['orderby'] ) ) { $orderby = $q['orderby']; } elseif ( isset( $q['post_status'] ) && in_array( $q['post_status'], array( 'pending', 'draft' ) ) ) { $orderby = 'modified'; } + $order = ''; + if ( isset( $q['order'] ) ) { $order = $q['order']; } elseif ( isset( $q['post_status'] ) && 'pending' == $q['post_status'] ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index d43b3c28c8..4698ef91d7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0.2-alpha-44183'; +$wp_version = '5.0.2-alpha-44185'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.