Make WordPress Core

Changeset 61349


Ignore:
Timestamp:
12/03/2025 08:52:53 PM (7 hours ago)
Author:
SergeyBiryukov
Message:

Database: Further correct MariaDB version check in wpdb::has_cap().

On older PHP versions, MariaDB version is reported with the 5.5.5- prefix, e.g. 5.5.5-10.6.24-MariaDB.

This includes PHP 8.0.15 or earlier, as well as PHP 8.1.0—8.1.2, which was not accounted for previously.

This commit updates the condition for removing the 5.5.5- prefix to include PHP 8.1.0—8.1.2.

Follow-up to [54384].

Props maximumsoftware, hbhalodia, SergeyBiryukov.
Fixes #64332.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wpdb.php

    r61243 r61349  
    40824082         */
    40834083        if ( '5.5.5' === $db_version && false !== strpos( $db_server_info, 'MariaDB' )
    4084             && PHP_VERSION_ID < 80016 // PHP 8.0.15 or older.
     4084            && ( PHP_VERSION_ID <= 80015 // PHP 8.0.15 or older.
     4085                || 80100 <= PHP_VERSION_ID && PHP_VERSION_ID <= 80102 ) // PHP 8.1.0 to PHP 8.1.2.
    40854086        ) {
    40864087            // Strip the '5.5.5-' prefix and set the version to the correct value.
Note: See TracChangeset for help on using the changeset viewer.