From: Platonides Date: Thu, 15 Dec 2011 21:21:30 +0000 (+0000) Subject: Simplify a bit the code of r106025 X-Git-Tag: 1.31.0-rc.0~25947 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=e8031547af6d0a662d6c12e3b629d946dd1a16d6;p=lhc%2Fweb%2Fwiklou.git Simplify a bit the code of r106025 --- diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index aa0b8ab69e..852ea2fb19 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -642,11 +642,13 @@ class DatabasePostgres extends DatabaseBase { # Split database and table into proper variables. # We reverse the explode so that schema.table and table both output # the correct table. - $dbDetails = array_reverse( explode( '.', $name, 2 ) ); + $dbDetails = explode( '.', $name, 2 ); if ( isset( $dbDetails[1] ) ) { - list( $table, $schema ) = $dbDetails; + $schema = '"' . $dbDetails[0] . '".'; + $table = $dbDetails [1]; } else { - list( $table ) = $dbDetails; + $schema = "\"{$wgDBmwschema}\"."; # keep old schema, but quote it. + $table = $dbDetails[0]; } if ( $format != 'quoted' ) { switch( $name ) { @@ -658,12 +660,7 @@ class DatabasePostgres extends DatabaseBase { return $table; } } - if ( !isset( $schema )) { - $schema = "\"{$wgDBmwschema}\"."; - } else { - # keep old schema, but quote it. - $schema = "\"{$schema}\"."; - } + # during installation wgDBmwschema is not set, so we would end up quering # ""."table" => error. Erase the first part if wgDBmwschema is empty if ( $schema == "\"\"." ) {