function DatabaseConnection::escapeTable
Escapes a table name string.
Force all table names to be strictly alphanumeric-plus-underscore. For some database drivers, it may also wrap the table name in database-specific escape characters.
Return value
string The sanitized table name string.
File
-
includes/
database/ database.inc, line 986
Class
- DatabaseConnection
- Base Database API class.
Code
public function escapeTable($table) {
if (!isset($this->escapedNames[$table])) {
$this->escapedNames[$table] = preg_replace('/[^A-Za-z0-9_.]+/', '', $table);
}
return $this->escapedNames[$table];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.