1 database.inc public DatabaseConnection::escapeAlias($field)

Escapes an alias name string.

Force all alias names to be strictly alphanumeric-plus-underscore. In contrast to DatabaseConnection::escapeField() / DatabaseConnection::escapeTable(), this doesn't allow the period (".") because that is not allowed in aliases.

Return value

string: The sanitized field name string.

File

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

Class

DatabaseConnection
Base Database API class.

Code

public function escapeAlias($field) {
  if (!isset($this->escapedAliases[$field])) {
    $this->escapedAliases[$field] = preg_replace('/[^A-Za-z0-9_]+/', '', $field);
  }
  return $this->escapedAliases[$field];
}