[BUGFIX] Install Tool shows internal MySQL databases
authorMario Rimann <typo3-coding@rimann.org>
Sun, 4 Dec 2011 21:53:52 +0000 (22:53 +0100)
committerDmitry Dulepov <dmitry@typo3.org>
Tue, 6 Dec 2011 13:26:33 +0000 (14:26 +0100)
This patch removes "mysql" and "information_schema" from the
list of databases that the install tool offers to choose from.

Change-Id: I4f407e5571e65005f24cba0b7cdf36e3782bf1c0
Resolves: #19278
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/7068
Reviewed-by: Oliver Klee
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
typo3/sysext/install/mod/class.tx_install.php

index 407c850..f6e7cb4 100644 (file)
@@ -3960,7 +3960,12 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                if ($result = $GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password)) {
                        $dbArr = $GLOBALS['TYPO3_DB']->admin_get_dbs();
                }
-               return $dbArr;
+
+                       // remove some database names that MySQL uses internally from the list of choosable DB names
+               $reservedDatabaseNames = array('mysql', 'information_schema');
+               $databaseList = array_diff($dbArr, $reservedDatabaseNames);
+
+               return $databaseList;
        }
 
        /**