From: Greg Sabino Mullane Date: Mon, 21 Mar 2011 21:20:11 +0000 (+0000) Subject: Do not depend on the lack of a server for connecting: Postgres has a valid and common... X-Git-Tag: 1.31.0-rc.0~31266 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=02c39cd896b41228b2f30067c3cfbef9c80883d3;p=lhc%2Fweb%2Fwiklou.git Do not depend on the lack of a server for connecting: Postgres has a valid and common use case where the server name (aka host) is empty, as the connection is via a Unix socket. Instead, check if a $user has been sent to the function, as all databases can agree that we need at least that much before doing an open. Fixes bug 28167. --- diff --git a/includes/db/Database.php b/includes/db/Database.php index 2a8c1982be..f6ab1f63ae 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -518,7 +518,7 @@ abstract class DatabaseBase implements DatabaseType { $this->mTablePrefix = $tablePrefix; } - if ( $server ) { + if ( $user ) { $this->open( $server, $user, $password, $dbName ); } }