1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-15 13:34:41 +01:00

Try and protect against people trying to select an inappropriate DBAL

git-svn-id: file:///svn/phpbb/trunk@6128 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Graham Eames 2006-06-26 21:05:49 +00:00
parent c476382934
commit b451ced10e
2 changed files with 22 additions and 0 deletions

View File

@ -1671,6 +1671,26 @@ class install_install extends module
}
$db->sql_freeresult($result);
// Make sure that the user has selected a sensible DBAL for the DBMS actually installed
switch ($dbms)
{
case 'mysql4':
if (version_compare(mysql_get_server_info(), '4.0.0', '<'))
{
$error[] = $lang['INST_ERR_DB_NO_MYSQL4'];
}
break;
case 'mysqli':
if (version_compare(mysqli_get_server_info(), '4.1.3', '<'))
{
$error[] = $lang['INST_ERR_DB_NO_MYSQLI'];
}
break;
}
$db->sql_close();
}

View File

@ -149,6 +149,8 @@ $lang = array_merge($lang, array(
'INSTALL_TEST' => 'Test Again',
'INST_ERR_DB_CONNECT' => 'Could not connect to the database, see error message below',
'INST_ERR_DB_NO_ERROR' => 'No error message given',
'INST_ERR_DB_NO_MYSQL4' => 'The version of MySQL installed on this machine is incompatible with the "MySQL 4.x/5.x" option you have selected. Please try the "MySQL 3.23.x/4.x" option instead.',
'INST_ERR_DB_NO_MYSQLI' => 'The version of MySQL installed on this machine is incompatible with the "MySQL 4.1.x/5.x with MySQLi Extension" option you have selected. Please try the "MySQL 4.x/5.x" or "MySQL 3.23.x/4.x" option instead.',
'INST_ERR_DB_NO_NAME' => 'No database name specified',
'INST_ERR_EMAIL_INVALID' => 'The email address you entered is invalid',
'INST_ERR_EMAIL_MISMATCH' => 'The emails you entered did not match.',