1 database.inc public DatabaseConnection::escapeTable($table)

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

core/includes/database/database.inc, line 934
Core systems for the database layer.

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];
}