You are here

function hosting_subdirs_valid_fqdn_subdir in Hosting 7.4

Same name and namespace in other branches
  1. 7.3 subdirs/hosting_subdirs.module \hosting_subdirs_valid_fqdn_subdir()

Check if the FQDN provided is valid for subdir alias.

Parameters

string $fqdn: The Fully Qualified Domain Name (FQDN) to validate.

Return value

bool TRUE if the $fqdn is valid or FALSE if it not valid.

1 call to hosting_subdirs_valid_fqdn_subdir()
hosting_subdirs_validate_alias in subdirs/hosting_subdirs.module
Ensure that an alias is valid for subdir site.

File

subdirs/hosting_subdirs.module, line 153
Allow sites to be installed in subdirectories.

Code

function hosting_subdirs_valid_fqdn_subdir($fqdn) {
  return preg_match("/^([a-z0-9]([a-z0-9-\\/]*[a-z0-9])?\\.?)+\$/i", $fqdn) && preg_match("/\\//", $fqdn) && !preg_match("/\\/\\//", $fqdn);
}