Skip to content
Extraits de code Groupes Projets
Valider 46381839 rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

fixes #5841 fix Uninitialized string offset if custom variable is an empty string

parent d22f4860
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -151,10 +151,15 @@ class Piwik ...@@ -151,10 +151,15 @@ class Piwik
$options .= self::getJavascriptTagOptions($idSite, $mergeSubdomains, $mergeAliasUrls); $options .= self::getJavascriptTagOptions($idSite, $mergeSubdomains, $mergeAliasUrls);
} }
$maxCustomVars = Plugins\CustomVariables\CustomVariables::getMaxCustomVariables(); $maxCustomVars = Plugins\CustomVariables\CustomVariables::getMaxCustomVariables();
if ($visitorCustomVariables) { if ($visitorCustomVariables) {
$options .= ' // you can set up to ' . $maxCustomVars . ' custom variables for each visitor' . PHP_EOL; $options .= ' // you can set up to ' . $maxCustomVars . ' custom variables for each visitor' . PHP_EOL;
$index = 1; $index = 1;
foreach ($visitorCustomVariables as $visitorCustomVariable) { foreach ($visitorCustomVariables as $visitorCustomVariable) {
if (empty($visitorCustomVariable)) {
continue;
}
$options .= ' _paq.push(["setCustomVariable", '.$index++.', "'.$visitorCustomVariable[0].'", "'.$visitorCustomVariable[1].'", "visit"]);' . PHP_EOL; $options .= ' _paq.push(["setCustomVariable", '.$index++.', "'.$visitorCustomVariable[0].'", "'.$visitorCustomVariable[1].'", "visit"]);' . PHP_EOL;
} }
} }
...@@ -162,6 +167,9 @@ class Piwik ...@@ -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; $options .= ' // you can set up to ' . $maxCustomVars . ' custom variables for each action (page view, download, click, site search)' . PHP_EOL;
$index = 1; $index = 1;
foreach ($pageCustomVariables as $pageCustomVariable) { foreach ($pageCustomVariables as $pageCustomVariable) {
if (empty($pageCustomVariable)) {
continue;
}
$options .= ' _paq.push(["setCustomVariable", '.$index++.', "'.$pageCustomVariable[0].'", "'.$pageCustomVariable[1].'", "page"]);' . PHP_EOL; $options .= ' _paq.push(["setCustomVariable", '.$index++.', "'.$pageCustomVariable[0].'", "'.$pageCustomVariable[1].'", "page"]);' . PHP_EOL;
} }
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter