r84490 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84489‎ | r84490 | r84491 >
Date:21:36, 21 March 2011
Author:greg
Status:ok
Tags:
Comment:
$safedb needs to be set *outside* the if/else block, not just inside the if
Fixes bug 28170
Modified paths:
  • /trunk/phase3/includes/installer/PostgresInstaller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/PostgresInstaller.php
@@ -224,8 +224,8 @@
225225
226226 $SQL = "SELECT 1 FROM pg_catalog.pg_database WHERE datname = " . $conn->addQuotes( $dbName );
227227 $rows = $conn->numRows( $conn->query( $SQL ) );
 228+ $safedb = $conn->addIdentifierQuotes( $dbName );
228229 if( !$rows ) {
229 - $safedb = $conn->addIdentifierQuotes( $dbName );
230230 $conn->query( "CREATE DATABASE $safedb OWNER $safeuser", __METHOD__ );
231231 } else {
232232 $conn->query( "ALTER DATABASE $safedb OWNER TO $safeuser", __METHOD__ );

Status & tagging log