Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -1925,11 +1925,13 @@ |
1926 | 1926 | * when calling query() directly. |
1927 | 1927 | * |
1928 | 1928 | * @param $name String: database table name |
1929 | | - * @param $quoted Boolean: Automatically pass the table name through |
1930 | | - * addIdentifierQuotes() so that it can be used in a query. |
| 1929 | + * @param $format String One of: |
| 1930 | + * quoted - Automatically pass the table name through addIdentifierQuotes() |
| 1931 | + * so that it can be used in a query. |
| 1932 | + * raw - Do not add identifier quotes to the table name |
1931 | 1933 | * @return String: full database name |
1932 | 1934 | */ |
1933 | | - function tableName( $name, $quoted = true ) { |
| 1935 | + function tableName( $name, $format = 'quoted' ) { |
1934 | 1936 | global $wgSharedDB, $wgSharedPrefix, $wgSharedTables; |
1935 | 1937 | # Skip the entire process when we have a string quoted on both ends. |
1936 | 1938 | # Note that we check the end so that we will still quote any use of |
— | — | @@ -1981,11 +1983,11 @@ |
1982 | 1984 | |
1983 | 1985 | # Quote the $database and $table and apply the prefix if not quoted. |
1984 | 1986 | if ( isset( $database ) ) { |
1985 | | - $database = ( !$quoted || $this->isQuotedIdentifier( $database ) ? $database : $this->addIdentifierQuotes( $database ) ); |
| 1987 | + $database = ( $format == 'quoted' || $this->isQuotedIdentifier( $database ) ? $database : $this->addIdentifierQuotes( $database ) ); |
1986 | 1988 | } |
1987 | 1989 | |
1988 | 1990 | $table = "{$prefix}{$table}"; |
1989 | | - if ( $quoted && !$this->isQuotedIdentifier( $table ) ) { |
| 1991 | + if ( $format == 'quoted' && !$this->isQuotedIdentifier( $table ) ) { |
1990 | 1992 | $table = $this->addIdentifierQuotes( "{$table}" ); |
1991 | 1993 | } |
1992 | 1994 | |