Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2018-07-02 12:10:31 +0300
committerStefan Giehl <stefan@piwik.org>2018-07-02 12:10:31 +0300
commit072e46d6cafc26d3c39eb7c965bf37bddb914039 (patch)
tree1b2d749babd2bcc0146a73b782cf380e69b4faa0 /core/SettingsPiwik.php
parente515c230a15be68e179a626c7f9ccfbab436e7cd (diff)
Improve detection of piwik/matomo URL (#13122)
refs a couple of issues I think. Eg https://github.com/matomo-org/matomo/issues/11029 For some reason that I cannot explain, it stored `127.0.0.1` as the matomo URL in the DB causing a bug in tag manager. So I opened a regular page in Matomo and was expecting it to correct the value in the option table but it didn't. I think this is because of the above change where it checks whether the previous URL is not a local host whereas it maybe should check on the current URL? See the debugger picture where it did not overwrite 127.0.0.1 with the correct current url/host because the host is currently a local host (127.0.0.1). If it checked whether the actual host is a local host, it would have updated it.
Diffstat (limited to 'core/SettingsPiwik.php')
-rw-r--r--core/SettingsPiwik.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/SettingsPiwik.php b/core/SettingsPiwik.php
index 3bc20bed73..bfd4ab4aeb 100644
--- a/core/SettingsPiwik.php
+++ b/core/SettingsPiwik.php
@@ -198,7 +198,7 @@ class SettingsPiwik
// if URL changes, always update the cache
|| $currentUrl != $url
) {
- $host = Url::getHostFromUrl($url);
+ $host = Url::getHostFromUrl($currentUrl);
if (strlen($currentUrl) >= strlen('http://a/')
&& !Url::isLocalHost($host)) {