Make WordPress Core

Changeset 45165


Ignore:
Timestamp:
04/12/2019 02:01:02 PM (6 years ago)
Author:
desrosj
Message:

Upgrade/Install: Prevent plugin auto updates if PHP version requirements are not satisfied.

In [44937] and [44939], changes were made to prevent a user from updating any plugin that requires a higher version of PHP than the site is running. This compliments those changes to also prevent plugins from being auto updated when the same requirements are not met.

Props: TimothyBlynJacobs, davidbaumwald.
Fixes #46613.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-automatic-updater.php

    r45137 r45165  
    202202
    203203            if ( ! $php_compat || ! $mysql_compat ) {
     204                return false;
     205            }
     206        }
     207
     208        // If updating a plugin, ensure the minimum PHP version requirements are satisfied.
     209        if ( 'plugin' === $type ) {
     210            if ( ! empty( $item->requires_php ) && version_compare( phpversion(), $item->requires_php, '<' ) ) {
    204211                return false;
    205212            }
Note: See TracChangeset for help on using the changeset viewer.