diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-05-12 06:46:42 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-05-12 06:46:42 +0400 |
commit | 3fc338a51bd001eec5a366e915d22abf84dcdc8b (patch) | |
tree | 3b6bce697dfaccb11eb8610e84c5c3584b825097 /core/Config.php | |
parent | c866f47f5e7b9f872db969324786f0b28e7750d7 (diff) |
Fixes issue when a port number is appended to the hostname, expected: pick the hostname'd config file (without port number)
Diffstat (limited to 'core/Config.php')
-rw-r--r-- | core/Config.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/Config.php b/core/Config.php index d08e89ce4c..2e093007c7 100644 --- a/core/Config.php +++ b/core/Config.php @@ -234,10 +234,19 @@ class Config extends Singleton return false; } + /** + * Returns the hostname of the current request (without port number) + * + * @return string + */ public static function getHostname() { // Check trusted requires config file which is not ready yet $host = Url::getHost($checkIfTrusted = false); + + // Remove any port number to get actual hostname + $host = Url::getHostSanitized($host); + return $host; } |