Skip to content
Permalink
Browse files

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.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@44185 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
desrosj committed Dec 14, 2018
1 parent 06adae5 commit 5ddf67a7f1e5c66fb630fde4e47a52e98ce6453e
Showing with 7 additions and 0 deletions.
  1. +1 −0 src/wp-admin/includes/plugin-install.php
  2. +6 −0 src/wp-admin/includes/post.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,
@@ -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'] ) {

0 comments on commit 5ddf67a

Please sign in to comment.
You can’t perform that action at this time.