[BUGFIX] Install Tool shows internal MySQL databases
authorMario Rimann <typo3-coding@rimann.org>
Sun, 4 Dec 2011 21:53:52 +0000 (22:53 +0100)
committerSteffen Gebert <steffen.gebert@typo3.org>
Sun, 11 Dec 2011 21:22:48 +0000 (22:22 +0100)
This patch removes "mysql" and "information_schema" from the
list of databases that the install tool offers to choose from.

Change-Id: I37fd85323f82c96941fadbf79c76b13041b5fb74
Resolves: #19278
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/7084
Reviewed-by: Oliver Hader
Reviewed-by: Oliver Klee
Reviewed-by: Mario Rimann
Reviewed-by: Simon Schaufelberger
Tested-by: Simon Schaufelberger
Reviewed-by: Steffen Gebert
Tested-by: Steffen Gebert
typo3/sysext/install/mod/class.tx_install.php

index 21b78f5..6e0db7c 100644 (file)
@@ -4026,7 +4026,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;
        }
 
        /**