Validates that a hostname (for example $_SERVER['HTTP_HOST']) is safe.
TRUE if only containing valid characters, or FALSE otherwise.
function drupal_valid_http_host($host) { return preg_match('/^\\[?(?:[a-zA-Z0-9-:\\]_]+\\.?)+$/', $host); }