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.
Built from https://develop.svn.wordpress.org/trunk@61349


git-svn-id: http://core.svn.wordpress.org/trunk@60661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2025-12-03 20:54:33 +00:00
parent 0d8aa03d93
commit ba8227c121
2 changed files with 3 additions and 2 deletions

View File

@@ -4081,7 +4081,8 @@ class wpdb {
* the polyfills from wp-includes/compat.php are not loaded.
*/
if ( '5.5.5' === $db_version && false !== strpos( $db_server_info, 'MariaDB' )
&& PHP_VERSION_ID < 80016 // PHP 8.0.15 or older.
&& ( PHP_VERSION_ID <= 80015 // PHP 8.0.15 or older.
|| 80100 <= PHP_VERSION_ID && PHP_VERSION_ID <= 80102 ) // PHP 8.1.0 to PHP 8.1.2.
) {
// Strip the '5.5.5-' prefix and set the version to the correct value.
$db_server_info = preg_replace( '/^5\.5\.5-(.*)/', '$1', $db_server_info );

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '7.0-alpha-61348';
$wp_version = '7.0-alpha-61349';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.