* names, other databases which use something other than backticks can replace
* this with something else
*/
- function quote_ident( $s ) {
+ public function addIdentifierQuotes( $s ) {
return "`" . $this->strencode( $s ) . "`";
}
+ /**
+ * Backwards compatibility, identifier quoting originated in DatabasePostgres
+ * which used quote_ident which does not follow our naming conventions
+ * was renamed to addIdentifierQuotes.
+ * @deprecated use addIdentifierQuotes
+ */
+ function quote_ident( $s ) {
+ wfDeprecated( __METHOD__ );
+ return $this->addIdentifierQuotes( $s );
+ }
+
/**
* Escape string for safe LIKE usage.
* WARNING: you should almost never use this function directly,
*
* '{$var}' should be used for text and is passed through the database's addQuotes method
* `{$var}` should be used for identifiers (eg: table and database names), it is passed through
- * the database's quote_ident method which can be overridden if the database
+ * the database's addIdentifierQuotes method which can be overridden if the database
* uses something other than backticks.
* / *$var* / is just encoded, besides traditional dbprefix and tableoptions it's use should be avoided
*
foreach ( $varnames as $var ) {
if ( isset( $GLOBALS[$var] ) ) {
$ins = str_replace( '\'{$' . $var . '}\'', $this->addQuotes( $GLOBALS[$var] ), $ins ); // replace '{$var}'
- $ins = str_replace( '`{$' . $var . '}`', $this->quote_ident( $GLOBALS[$var] ), $ins ); // replace `{$var}`
+ $ins = str_replace( '`{$' . $var . '}`', $this->addIdentifierQuotes( $GLOBALS[$var] ), $ins ); // replace `{$var}`
$ins = str_replace( '/*$' . $var . '*/', $this->strencode( $GLOBALS[$var] ) , $ins ); // replace /*$var*/
}
}