Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions modules/sub_domains/code/controller.ext.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,19 +243,25 @@ static function CheckErrorDocument($error)
return in_array($error, $errordocs);
}

static function IsValidDomainName($a)
static function IsValidDomainName($a)
{
if (stristr($a, '.')) {
$part = explode(".", $a);
foreach ($part as $check) {
if (!preg_match('/^[a-z\d][a-z\d-]{0,62}$/i', $check) || preg_match('/-$/', $check)) {
return false;
}
$currentuser = ctrl_users::GetUserDetail();

if (stristr($a, '.')) {
$part = explode(".", $a);
foreach ($part as $check) {
if (($currentuser['subdomainquota'] < 0) && (preg_match('/^[\*a-z\d][a-z\d-]{0,62}$/i', $check)) && (!preg_match('/-$/', $check))) {
return true;
}
elseif (($currentuser['subdomainquota'] > 0) && (preg_match('/^[a-z\d][a-z\d-]{0,62}$/i', $check)) && (!preg_match('/-$/', $check))) {
return true;
} else {
return false;
}
} else {
return false;
}
return true;
} else {
return false;
}
}

static function IsValidEmail($email)
Expand Down