From: Tim Starling Date: Sun, 10 Apr 2005 18:26:26 +0000 (+0000) Subject: ported improved table quoting from 1.4 X-Git-Tag: 1.5.0alpha1~313 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=abfd2e75001162231246cc4b7a9642bbabf4e390;p=lhc%2Fweb%2Fwiklou.git ported improved table quoting from 1.4 --- diff --git a/includes/Database.php b/includes/Database.php index fee9453a94..7c38b0fc0d 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -964,17 +964,18 @@ class Database { */ function tableName( $name ) { global $wgSharedDB; - if ( $this->mTablePrefix !== '' ) { - if ( strpos( '.', $name ) === false ) { - $name = $this->mTablePrefix . $name; + # Skip quoted literals + if ( $name{0} != '`' ) { + if ( $this->mTablePrefix !== '' && strpos( '.', $name ) === false ) { + $name = "{$this->mTablePrefix}$name"; } - } - if ( isset( $wgSharedDB ) && 'user' == $name ) { - $name = $wgSharedDB . '.' . $name; - } - if( $name == 'group' ) { - $name = '`' . $name . '`'; - } + if ( isset( $wgSharedDB ) && 'user' == $name ) { + $name = "`$wgSharedDB`.`$name`"; + } else { + # Standard quoting + $name = "`$name`"; + } + } return $name; }