diff options
Diffstat (limited to 'core/Config.php')
-rw-r--r-- | core/Config.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/Config.php b/core/Config.php index d56bdeac5d..f1230fd223 100644 --- a/core/Config.php +++ b/core/Config.php @@ -139,7 +139,7 @@ class Config if (!empty($GLOBALS['CONFIG_INI_PATH_RESOLVER']) && is_callable($GLOBALS['CONFIG_INI_PATH_RESOLVER'])) { return call_user_func($GLOBALS['CONFIG_INI_PATH_RESOLVER']); } - + $path = self::getByDomainConfigPath(); if ($path) { return $path; @@ -220,13 +220,14 @@ class Config /** * Returns the hostname of the current request (without port number) + * @param bool $checkIfTrusted Check trusted requires config which is maybe not ready yet, + * make sure the config is ready when you call with true * * @return string */ - public static function getHostname() + public static function getHostname($checkIfTrusted = false) { - // Check trusted requires config file which is not ready yet - $host = Url::getHost($checkIfTrusted = false); + $host = Url::getHost($checkIfTrusted); // Remove any port number to get actual hostname $host = Url::getHostSanitized($host); @@ -309,7 +310,7 @@ class Config public function deleteLocalConfig() { $configLocal = $this->getLocalPath(); - + if(file_exists($configLocal)){ @unlink($configLocal); } @@ -345,7 +346,7 @@ class Config { return $this->settings->getIniFileChain()->getFrom($this->getCommonPath(), $name); } - + /** * @api */ |