mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/11015] Make phpbb_convert_30_dbms_to_31 more future proof
It should allow any class name in the future, as long as that class exists. And it should give a useful error message otherwise. PHPBB3-11015
This commit is contained in:
parent
5bc0f4b3d4
commit
0372ecf141
1 changed files with 8 additions and 3 deletions
|
@ -5421,10 +5421,15 @@ function phpbb_to_numeric($input)
|
|||
*/
|
||||
function phpbb_convert_30_dbms_to_31($dbms)
|
||||
{
|
||||
if (!preg_match('#^phpbb_db_driver_#', $dbms))
|
||||
if (class_exists($dbms))
|
||||
{
|
||||
return 'phpbb_db_driver_'.$dbms;
|
||||
return $dbms;
|
||||
}
|
||||
|
||||
return $dbms;
|
||||
if (class_exists('phpbb_db_driver_' . $dbms))
|
||||
{
|
||||
return 'phpbb_db_driver_' . $dbms;
|
||||
}
|
||||
|
||||
throw new \RuntimeException('You have specified an invalid dbms driver.');
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue