Skip to content

Commit

Permalink
Removing HTTP_BASE env check
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Sep 10, 2014
1 parent a9f2937 commit 6025893
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions src/Core/functions.php
Expand Up @@ -191,45 +191,6 @@ function env($key) {
return str_replace(env('DOCUMENT_ROOT'), '', env('SCRIPT_FILENAME'));
case 'CGI_MODE':
return (PHP_SAPI === 'cgi');
case 'HTTP_BASE':
$host = env('HTTP_HOST');
$parts = explode('.', $host);
$count = count($parts);

if ($count === 1) {
return '.' . $host;
} elseif ($count === 2) {
return '.' . $host;
} elseif ($count === 3) {
$gTLD = array(
'aero',
'asia',
'biz',
'cat',
'com',
'coop',
'edu',
'gov',
'info',
'int',
'jobs',
'mil',
'mobi',
'museum',
'name',
'net',
'org',
'pro',
'tel',
'travel',
'xxx'
);
if (in_array($parts[1], $gTLD)) {
return '.' . $host;
}
}
array_shift($parts);
return '.' . implode('.', $parts);
}
return null;
}
Expand Down

0 comments on commit 6025893

Please sign in to comment.