[BUGFIX] Installer fix crash with faulty DB data 64/19564/2
authorAlexander Opitz <opitz.alexander@googlemail.com>
Fri, 5 Apr 2013 09:20:49 +0000 (11:20 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 5 Apr 2013 11:39:56 +0000 (13:39 +0200)
If the database config, given in step 2 of install tool are faulty,
we recognice that for step 3 but try to get all database tables
in that state. Which will crash PHP since MySQLi changes.

You can reproduce this by using faulty DB data on step 2 in the
123-installer.

Resolves: #46932
Releases: 6.1
Change-Id: Ib6c756183a8ec23417115b7070d7e5ffae869a3a
Reviewed-on: https://review.typo3.org/19564
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/install/Classes/Installer.php

index 7401bcc..4eecb1e 100644 (file)
@@ -871,8 +871,10 @@ REMOTE_ADDR was \'' . \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REMOTE
                        </p>
                ';
                // only get the number of tables if it is not the first two steps in the 123-installer
-               // (= no DB connection yet)
-               $whichTables = $this->step != 1 && $this->step != 2 ? $this->sqlHandler->getListOfTables() : array();
+               // (= no DB connection yet) or connect failed
+               $whichTables = $this->step != 1 && $this->step != 2 && $this->fatalError !== 1
+                       ? $this->sqlHandler->getListOfTables() : array();
+
                $error_emptyDB = '
                        <p class="typo3-message message-error">
                                <strong>