diff options
-rw-r--r-- | plugins/Installation/Controller.php | 7 | ||||
-rw-r--r-- | plugins/Login/Controller.php | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/plugins/Installation/Controller.php b/plugins/Installation/Controller.php index a68278f334..d621cd5ca4 100644 --- a/plugins/Installation/Controller.php +++ b/plugins/Installation/Controller.php @@ -525,7 +525,7 @@ class Piwik_Installation_Controller extends Piwik_Controller if(!file_exists(Piwik_Config::getLocalConfigPath())) { - $this->addTrustedHosts(); +// $this->addTrustedHosts(); $this->writeConfigFileFromSession(); } @@ -693,10 +693,8 @@ class Piwik_Installation_Controller extends Piwik_Controller */ protected function extractHost($url) { - $skipLocalHosts = array('localhost', '127.0.0.1', '[::1]'); - $urlParts = parse_url($url); - if (isset($urlParts['host']) && strlen($host = $urlParts['host']) && !in_array($host, $skipLocalHosts)) + if (isset($urlParts['host']) && strlen($host = $urlParts['host'])) { return $host; } @@ -723,6 +721,7 @@ class Piwik_Installation_Controller extends Piwik_Controller $trustedHosts[] = $host; } + $trustedHosts = array_unique($trustedHosts); if (count($trustedHosts)) { $this->session->general_infos['trusted_hosts'] = $trustedHosts; diff --git a/plugins/Login/Controller.php b/plugins/Login/Controller.php index 6daf725bb6..d33bc4e451 100644 --- a/plugins/Login/Controller.php +++ b/plugins/Login/Controller.php @@ -194,7 +194,9 @@ class Piwik_Login_Controller extends Piwik_Controller protected function getMessageExceptionNoAccess() { - return Piwik_Translate('Login_InvalidNonceOrHeadersOrReferer', array('<a href="?module=Proxy&action=redirect&url='.urlencode('http://piwik.org/faq/how-to-install/#faq_98').'" target="_blank">', '</a>')); + $message = Piwik_Translate('Login_InvalidNonceOrHeadersOrReferer', array('<a href="?module=Proxy&action=redirect&url='.urlencode('http://piwik.org/faq/how-to-install/#faq_98').'" target="_blank">', '</a>')); + // Should mention trusted_hosts or link to FAQ + return $message; } /** |