[ticket/16965] Allow empty value as default database server name on installing

PHPBB3-16965
This commit is contained in:
rxu 2022-02-11 10:02:33 +07:00
parent 510a923ba9
commit ae799c57c0
No known key found for this signature in database
GPG key ID: 14C89C9F50DA21E6

View file

@ -37,7 +37,7 @@ class connection_parameter_factory
*/ */
public static function get_configuration( public static function get_configuration(
string $driver, string $driver,
string $host, ?string $host = null,
?string $user = null, ?string $user = null,
?string $password = null, ?string $password = null,
?string $name = null, ?string $name = null,
@ -73,7 +73,7 @@ class connection_parameter_factory
*/ */
private static function build_connection_parameters( private static function build_connection_parameters(
array $params, array $params,
string $host, ?string $host = null,
?string $user = null, ?string $user = null,
?string $password = null, ?string $password = null,
?string $name = null, ?string $name = null,
@ -86,7 +86,7 @@ class connection_parameter_factory
); );
} }
if (empty($host) || empty($user) || empty($name)) if (empty($user) || empty($name))
{ {
throw new InvalidArgumentException('Required database parameter is not set.'); throw new InvalidArgumentException('Required database parameter is not set.');
} }