| Versions | |
|---|---|
| 4.7 – 6 | db_escape_table( |
| 7 | db_escape_table($table) |
Restrict a dynamic table, column or constraint name to safe characters.
Only keeps alphanumeric and underscores.
drupal/
<?php
function db_escape_table($string) {
return preg_replace('/[^A-Za-z0-9_]+/', '', $string);
}
?>