From: Pradeep Nayak Date: Fri, 11 Sep 2015 18:49:12 +0000 (+0530) Subject: --CRM-16617, stop further processing if DB name is invalid X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=372440e25ebc46c4597cec8707f336035ee4b00b;p=civicrm-core.git --CRM-16617, stop further processing if DB name is invalid --- 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; } }