Skip to content

Commit 0b50baa

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@61349 602fd350-edb4-49c9-b593-d223f7449a82
1 parent df16189 commit 0b50baa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/wp-includes/class-wpdb.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4081,7 +4081,8 @@ public function has_cap( $db_cap ) {
40814081
* the polyfills from wp-includes/compat.php are not loaded.
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.
40874088
$db_server_info = preg_replace( '/^5\.5\.5-(.*)/', '$1', $db_server_info );

0 commit comments

Comments
 (0)