Make WordPress Core


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

Upgrade/Install: Make version_compare() calls for plugin required version checks more robust.

Props afragen.
Fixes #46024. See #43986.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin-install.php

    r44627 r44656  
    757757    $wp_version = get_bloginfo( 'version' );
    758758
    759     $compatible_php = ( empty( $api->requires_php ) || version_compare( substr( phpversion(), 0, strlen( $api->requires_php ) ), $api->requires_php, '>=' ) );
    760     $tested_wp      = ( empty( $api->tested ) || version_compare( substr( $wp_version, 0, strlen( $api->tested ) ), $api->tested, '<=' ) );
    761     $compatible_wp  = ( empty( $api->requires ) || version_compare( substr( $wp_version, 0, strlen( $api->requires ) ), $api->requires, '>=' ) );
     759    $compatible_php = ( empty( $api->requires_php ) || version_compare( phpversion(), $api->requires_php, '>=' ) );
     760    $tested_wp      = ( empty( $api->tested ) || version_compare( $wp_version, $api->tested, '<=' ) );
     761    $compatible_wp  = ( empty( $api->requires ) || version_compare( $wp_version, $api->requires, '>=' ) );
    762762
    763763    if ( ! $compatible_php ) {
Note: See TracChangeset for help on using the changeset viewer.