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:
authormattab <matthieu.aubry@gmail.com>2014-09-23 09:03:32 +0400
committermattab <matthieu.aubry@gmail.com>2014-09-23 09:03:32 +0400
commitac7827f1d713ffb49f7bb7eb57394338e3847fd3 (patch)
treebadc4a6f0ff4f0b22eab2b4b0d7d55ad522d33ad /core/Piwik.php
parent3f900064f31ed7ace41b83172568cdcd3d8ac6fa (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.php2
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;