You are here

protected function DatabaseConnection_sqlsrv::replaceReservedCallback in Drupal driver for SQL Server and SQL Azure 7

Same name and namespace in other branches
  1. 7.3 sqlsrv/database.inc \DatabaseConnection_sqlsrv::replaceReservedCallback()
  2. 7.2 sqlsrv/database.inc \DatabaseConnection_sqlsrv::replaceReservedCallback()

File

sqlsrv/database.inc, line 177
Database interface code for Microsoft SQL Server.

Class

DatabaseConnection_sqlsrv

Code

protected function replaceReservedCallback($matches) {
  if ($matches[1] !== '') {

    // Replace reserved words.
    return '[' . $matches[1] . ']';
  }

  // Let other value passthru.
  // by the logic of the regex above, this will always be the last match.
  return end($matches);
}