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 <thomas.steur@googlemail.com>2014-07-18 19:22:33 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-07-18 19:22:33 +0400
commit46381839b0ce17d854b5fbbc07a38ba2b1de324f (patch)
tree76b709ffe911d1da7aa5f0907ffb07750c2eea95 /core/Piwik.php
parentd22f486081cf14a6ca55319652ecf3b4e625e7f3 (diff)
fixes #5841 fix Uninitialized string offset if custom variable is an empty string
Diffstat (limited to 'core/Piwik.php')
-rw-r--r--core/Piwik.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/Piwik.php b/core/Piwik.php
index d1baf061ff..e2f1733cd4 100644
--- a/core/Piwik.php
+++ b/core/Piwik.php
@@ -151,10 +151,15 @@ class Piwik
$options .= self::getJavascriptTagOptions($idSite, $mergeSubdomains, $mergeAliasUrls);
}
$maxCustomVars = Plugins\CustomVariables\CustomVariables::getMaxCustomVariables();
+
if ($visitorCustomVariables) {
$options .= ' // you can set up to ' . $maxCustomVars . ' custom variables for each visitor' . PHP_EOL;
$index = 1;
foreach ($visitorCustomVariables as $visitorCustomVariable) {
+ if (empty($visitorCustomVariable)) {
+ continue;
+ }
+
$options .= ' _paq.push(["setCustomVariable", '.$index++.', "'.$visitorCustomVariable[0].'", "'.$visitorCustomVariable[1].'", "visit"]);' . PHP_EOL;
}
}
@@ -162,6 +167,9 @@ class Piwik
$options .= ' // you can set up to ' . $maxCustomVars . ' custom variables for each action (page view, download, click, site search)' . PHP_EOL;
$index = 1;
foreach ($pageCustomVariables as $pageCustomVariable) {
+ if (empty($pageCustomVariable)) {
+ continue;
+ }
$options .= ' _paq.push(["setCustomVariable", '.$index++.', "'.$pageCustomVariable[0].'", "'.$pageCustomVariable[1].'", "page"]);' . PHP_EOL;
}
}