Skip to content

Commit 69a55d1

Browse files
Fixes type error when setting Config::$db_port in upgrader
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
1 parent 156c769 commit 69a55d1

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

Sources/Maintenance/Tools/Upgrade.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,18 +1119,15 @@ public function upgradeOptions(): bool
11191119
// If they have a "host:port" setup for the host, split that into separate values
11201120
// You should never have a : in the hostname if you're not on MySQL, but better safe than sorry
11211121
if (strpos(Config::$db_server, ':') !== false) {
1122-
list(Config::$db_server, Config::$db_port) = explode(':', Config::$db_server);
1122+
list(Config::$db_server, $db_port) = explode(':', Config::$db_server);
1123+
Config::$db_port = (int) $db_port;
11231124

11241125
$file_settings['db_server'] = Config::$db_server;
1125-
1126-
// Only set this if we're not using the default port
1127-
if (Config::$db_port != Db::$db->getDefaultPort()) {
1128-
$file_settings['db_port'] = (int) Config::$db_port;
1129-
}
1126+
$file_settings['db_port'] = Config::$db_port;
11301127
}
11311128

11321129
// If db_port is set and is the same as the default, set it to 0.
1133-
if (!empty(Config::$db_port) && Config::$db_port != Db::$db->getDefaultPort()) {
1130+
if (!empty(Config::$db_port) && Config::$db_port == Db::$db->getDefaultPort()) {
11341131
$file_settings['db_port'] = 0;
11351132
}
11361133

0 commit comments

Comments
 (0)