From: Greg Sabino Mullane Date: Mon, 21 Mar 2011 21:36:21 +0000 (+0000) Subject: $safedb needs to be set *outside* the if/else block, not just inside the if X-Git-Tag: 1.31.0-rc.0~31264 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=cfb993f5b96f40287471acf521ed2a2ce57a440c;p=lhc%2Fweb%2Fwiklou.git $safedb needs to be set *outside* the if/else block, not just inside the if Fixes bug 28170 --- diff --git a/includes/installer/PostgresInstaller.php b/includes/installer/PostgresInstaller.php index bf6d8d4086..1a3a420f7d 100644 --- a/includes/installer/PostgresInstaller.php +++ b/includes/installer/PostgresInstaller.php @@ -224,8 +224,8 @@ class PostgresInstaller extends DatabaseInstaller { $SQL = "SELECT 1 FROM pg_catalog.pg_database WHERE datname = " . $conn->addQuotes( $dbName ); $rows = $conn->numRows( $conn->query( $SQL ) ); + $safedb = $conn->addIdentifierQuotes( $dbName ); if( !$rows ) { - $safedb = $conn->addIdentifierQuotes( $dbName ); $conn->query( "CREATE DATABASE $safedb OWNER $safeuser", __METHOD__ ); } else { $conn->query( "ALTER DATABASE $safedb OWNER TO $safeuser", __METHOD__ );