Skip to content
Permalink
Browse files

WP-r44297: PHP 7.3 Compatibility: Fix compact related notices (#332)

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 https://core.trac.wordpress.org/ticket/44416.

Merges https://core.trac.wordpress.org/changeset/44185 into trunk.

Fixes https://core.trac.wordpress.org/ticket/45483.

Conflicts:
  src/wp-admin/includes/post.php
----
Merges https://core.trac.wordpress.org/changeset/44297 / WordPress/wordpress-develop@7cda240 to ClassicPress.

See #263.
  • Loading branch information...
Mte90 authored and nylen committed Jan 28, 2019
1 parent cf59f89 commit ce080b2adcdb1440de8fbc7d304dd5e9dc07dfaa
Showing with 8 additions and 1 deletion.
  1. +1 −0 src/wp-admin/includes/plugin-install.php
  2. +7 −1 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,
@@ -1028,19 +1028,25 @@ function wp_edit_posts_query( $q = false ) {
else
$post_type = 'post';
$avail_post_stati = get_available_post_statuses($post_type);
$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 ce080b2

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