[BUGFIX] DBAL: use correct default value for native connection 38/45338/3
authorMelanie Kalka <melanie.kalka@sunzinet.com>
Thu, 17 Dec 2015 15:08:31 +0000 (16:08 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Thu, 17 Dec 2015 16:21:01 +0000 (17:21 +0100)
DBAL uses an empty string for the portnumber parameter
for mysqli real_connect, which results in a PHP warning,
because an integer (or null) is required.

Changing the fallback to null resolves this issue and
results in a working database connection.

Resolves: #72285
Releases: master, 6.2
Change-Id: Ie0e04f3ab04996ab634f99c3d2ab545d4a3b3819
Reviewed-on: https://review.typo3.org/45338
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/dbal/Classes/Database/DatabaseConnection.php

index 95e46f8..2f354d3 100644 (file)
@@ -3145,7 +3145,7 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection
                     $cfgArray['config']['username'],
                     $cfgArray['config']['password'],
                     $cfgArray['config']['database'],
-                    isset($cfgArray['config']['port']) ? $cfgArray['config']['port'] : ''
+                    isset($cfgArray['config']['port']) ? $cfgArray['config']['port'] : null
                 );
                 if ($connected) {
                     // Set handler instance: