mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-24 09:11:24 +01:00
Upgrade/Install: Make version_compare()
calls for plugin required version checks more robust.
Props afragen. Fixes #46024. See #43986. Built from https://develop.svn.wordpress.org/trunk@44656 git-svn-id: http://core.svn.wordpress.org/trunk@44487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5e6e3573bf
commit
9f2d529a77
@ -504,9 +504,9 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
|
|||||||
|
|
||||||
$wp_version = get_bloginfo( 'version' );
|
$wp_version = get_bloginfo( 'version' );
|
||||||
|
|
||||||
$compatible_php = ( empty( $plugin['requires_php'] ) || version_compare( substr( phpversion(), 0, strlen( $plugin['requires_php'] ) ), $plugin['requires_php'], '>=' ) );
|
$compatible_php = ( empty( $plugin['requires_php'] ) || version_compare( phpversion(), $plugin['requires_php'], '>=' ) );
|
||||||
$tested_wp = ( empty( $plugin['tested'] ) || version_compare( substr( $wp_version, 0, strlen( $plugin['tested'] ) ), $plugin['tested'], '<=' ) );
|
$tested_wp = ( empty( $plugin['tested'] ) || version_compare( $wp_version, $plugin['tested'], '<=' ) );
|
||||||
$compatible_wp = ( empty( $plugin['requires'] ) || version_compare( substr( $wp_version, 0, strlen( $plugin['requires'] ) ), $plugin['requires'], '>=' ) );
|
$compatible_wp = ( empty( $plugin['requires'] ) || version_compare( $wp_version, $plugin['requires'], '>=' ) );
|
||||||
|
|
||||||
$action_links = array();
|
$action_links = array();
|
||||||
|
|
||||||
|
@ -756,9 +756,9 @@ function install_plugin_information() {
|
|||||||
<?php
|
<?php
|
||||||
$wp_version = get_bloginfo( 'version' );
|
$wp_version = get_bloginfo( 'version' );
|
||||||
|
|
||||||
$compatible_php = ( empty( $api->requires_php ) || version_compare( substr( phpversion(), 0, strlen( $api->requires_php ) ), $api->requires_php, '>=' ) );
|
$compatible_php = ( empty( $api->requires_php ) || version_compare( phpversion(), $api->requires_php, '>=' ) );
|
||||||
$tested_wp = ( empty( $api->tested ) || version_compare( substr( $wp_version, 0, strlen( $api->tested ) ), $api->tested, '<=' ) );
|
$tested_wp = ( empty( $api->tested ) || version_compare( $wp_version, $api->tested, '<=' ) );
|
||||||
$compatible_wp = ( empty( $api->requires ) || version_compare( substr( $wp_version, 0, strlen( $api->requires ) ), $api->requires, '>=' ) );
|
$compatible_wp = ( empty( $api->requires ) || version_compare( $wp_version, $api->requires, '>=' ) );
|
||||||
|
|
||||||
if ( ! $compatible_php ) {
|
if ( ! $compatible_php ) {
|
||||||
echo '<div class="notice notice-error notice-alt"><p>';
|
echo '<div class="notice notice-error notice-alt"><p>';
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.1-beta1-44655';
|
$wp_version = '5.1-beta1-44656';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user