diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-09-23 09:03:32 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-09-23 09:03:32 +0400 |
commit | ac7827f1d713ffb49f7bb7eb57394338e3847fd3 (patch) | |
tree | badc4a6f0ff4f0b22eab2b4b0d7d55ad522d33ad /core/Piwik.php | |
parent | 3f900064f31ed7ace41b83172568cdcd3d8ac6fa (diff) |
fix regression when HTTPS URL is different from HTTP Tracker URL, both should be used in the generated tracking code refs #344
Diffstat (limited to 'core/Piwik.php')
-rw-r--r-- | core/Piwik.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/Piwik.php b/core/Piwik.php index 7a782033a2..e52f329404 100644 --- a/core/Piwik.php +++ b/core/Piwik.php @@ -214,7 +214,9 @@ class Piwik self::postEvent('Piwik.getJavascriptCode', array(&$codeImpl, $parameters)); $setTrackerUrl = 'var u="//{$piwikUrl}/";'; + if (!empty($codeImpl['httpsPiwikUrl'])) { + $setTrackerUrl = 'var u=((document.location.protocol === "https:") ? "https://{$httpsPiwikUrl}/" : "http://{$piwikUrl}/");'; $codeImpl['httpsPiwikUrl'] = rtrim($codeImpl['httpsPiwikUrl'], "/"); } $codeImpl = array('setTrackerUrl' => htmlentities($setTrackerUrl)) + $codeImpl; |