From f23af6f485f7ded1934b5173bf331d151f15713f Mon Sep 17 00:00:00 2001 From: rxu Date: Fri, 30 May 2025 11:54:32 +0700 Subject: [PATCH] [ticket/17509] Add MariaDB version requirement check PHPBB-17509 --- phpBB/language/en/install.php | 1 + phpBB/phpbb/install/helper/database.php | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 0d37cf5bb4..508cea2908 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -202,6 +202,7 @@ $lang = array_merge($lang, array( 'INST_ERR_DB_NO_WRITABLE' => 'Both the database and the directory containing it must be writable.', 'INST_ERR_DB_NO_ERROR' => 'No error message given.', 'INST_ERR_PREFIX' => 'Tables with the specified prefix already exist, please choose an alternative.', + 'INST_ERR_DB_NO_MARIADB' => 'The version of MariaDB installed on this machine is too old, it must be upgraded to at least 10.2.7.', 'INST_ERR_DB_NO_MYSQLI' => 'The version of MySQL installed on this machine is too old, it must be upgraded to at least 5.6.', 'INST_ERR_DB_NO_MSSQL' => 'The version of Microsoft SQL Server installed on this machine is too old, it must be upgraded to at least SQL Server 2012 (11.0.2100.60)', 'INST_ERR_DB_NO_SQLITE3' => 'The version of the SQLite extension you have installed is too old, it must be upgraded to at least 3.8.3.', diff --git a/phpBB/phpbb/install/helper/database.php b/phpBB/phpbb/install/helper/database.php index 5b1e74a807..ddf4a503b7 100644 --- a/phpBB/phpbb/install/helper/database.php +++ b/phpBB/phpbb/install/helper/database.php @@ -410,12 +410,21 @@ class database switch ($dbms) { case 'mysqli': - if (version_compare($db_server_version, '5.6', '<')) + if (stripos($db->sql_server_info(), 'mariadb') !== false && version_compare($db_server_version, '10.2.7', '<')) { $errors[] = array( - 'title' => 'INST_ERR_DB_NO_MYSQLI', + 'title' => 'INST_ERR_DB_NO_MARIADB', ); } + else + { + if (version_compare($db_server_version, '5.6', '<')) + { + $errors[] = array( + 'title' => 'INST_ERR_DB_NO_MYSQLI', + ); + } + } break; case 'sqlite3': if (version_compare($db_server_version, '3.8.3', '<'))