function drupal_valid_http_host

Validates that a hostname (for example $_SERVER['HTTP_HOST']) is safe.

Return value

TRUE if only containing valid characters, or FALSE otherwise.

1 call to drupal_valid_http_host()
drupal_environment_initialize in drupal/core/includes/bootstrap.inc
Initializes the PHP environment.

File

drupal/core/includes/bootstrap.inc, line 581
Functions that need to be loaded on every Drupal request.

Code

function drupal_valid_http_host($host) {
  return preg_match('/^\\[?(?:[a-zA-Z0-9-:\\]_]+\\.?)+$/', $host);
}