From 372440e25ebc46c4597cec8707f336035ee4b00b Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Sat, 12 Sep 2015 00:19:12 +0530 Subject: [PATCH] --CRM-16617, stop further processing if DB name is invalid --- install/index.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/install/index.php b/install/index.php index 69cae03501..a4f4d719e2 100644 --- a/install/index.php +++ b/install/index.php @@ -340,6 +340,16 @@ class InstallRequirements { ts("An auto_increment_increment value greater than 1 is not currently supported. Please see issue CRM-7923 for further details and potential workaround."), ) ); + if (!$this->requireValidDBName( + $databaseConfig['database'], + array( + ts("MySQL %1 Configuration", array(1 => $dbName)), + ts("Is the provided database name valid?"), + ts("The database name provided is not valid. Please use only 0-9, a-z, A-Z and _ as characters in the name."), + )) + ) { + return FALSE; + } $this->requireMySQLThreadStack($databaseConfig['server'], $databaseConfig['username'], $databaseConfig['password'], @@ -354,14 +364,6 @@ class InstallRequirements { ); } $onlyRequire = ($dbName == 'Drupal') ? TRUE : FALSE; - $this->requireValidDBName( - $databaseConfig['database'], - array( - ts("MySQL %1 Configuration", array(1 => $dbName)), - ts("Is the provided database name valid?"), - ts("The database name provided is not valid. Please use only 0-9, a-z, A-Z and _ as characters in the name."), - ) - ); $this->requireDatabaseOrCreatePermissions( $databaseConfig['server'], $databaseConfig['username'], @@ -1233,8 +1235,10 @@ class InstallRequirements { ); if (empty($matches)) { $this->error($testDetails); - return; + return FALSE; } + $this->testing($testDetails); + return TRUE; } } -- 2.25.1