Skip to content

Commit 18329b0

Browse files
committed
[BUGFIX] Avoid TypeError for database port handling
Using the `typo3DatabasePort` environment variable to define the database server port string-casts the value to an string which is not compatible with the mysqli method `mysqli::real_connect()` and fails with: TypeError: mysqli::real_connect(): Argument #5 ($port) must be of type ?int, string given This change casts the database port to an integer in case a port is provided to avoid PHP TypeError when passing to `mysqli::real_connect()` to align with `ConnectionPool`, which is not used to create the database for the functional test instance. Resolves: #631 Releases: main, 8
1 parent 1530ae5 commit 18329b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Classes/Core/Testbase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ public function getOriginalDatabaseSettingsFromEnvironmentOrLocalConfiguration(a
453453
$originalConfigurationArray['DB']['Connections']['Default']['password'] = $databasePasswordTrimmed;
454454
}
455455
if ($databasePort) {
456-
$originalConfigurationArray['DB']['Connections']['Default']['port'] = $databasePort;
456+
$originalConfigurationArray['DB']['Connections']['Default']['port'] = (int)$databasePort;
457457
}
458458
if ($databaseSocket) {
459459
$originalConfigurationArray['DB']['Connections']['Default']['unix_socket'] = $databaseSocket;

0 commit comments

Comments
 (0)