From ba8227c12114cd91308eacad166c8785a07e15c0 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 3 Dec 2025 20:54:33 +0000 Subject: [PATCH] Database: Further correct MariaDB version check in `wpdb::has_cap()`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- wp-includes/class-wpdb.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wpdb.php b/wp-includes/class-wpdb.php index 68f1acfdf7..23c865b87d 100644 --- a/wp-includes/class-wpdb.php +++ b/wp-includes/class-wpdb.php @@ -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 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 13192f7a92..af823242ca 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.