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
path: root/core
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-04-03 08:03:19 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-04-03 08:03:19 +0400
commit5cbbb4f47b69e977aa43b4403fb3459187f0111b (patch)
treeb66c2bfa0b3aa21c739fea8d245e83bd7ed48195 /core
parentbaa840bf4a5d16bb6097625671c6e55d30becbac (diff)
some more tweaks and added a comment to get info about currently configured custom vars
Diffstat (limited to 'core')
-rw-r--r--core/Tracker/GoalManager.php8
-rw-r--r--core/Tracker/Request.php3
-rw-r--r--core/Tracker/Visit.php3
3 files changed, 9 insertions, 5 deletions
diff --git a/core/Tracker/GoalManager.php b/core/Tracker/GoalManager.php
index c4e7fb67db..daa88bd7b9 100644
--- a/core/Tracker/GoalManager.php
+++ b/core/Tracker/GoalManager.php
@@ -227,7 +227,11 @@ class GoalManager
}
// Copy Custom Variables from Visit row to the Goal conversion
- for ($i = 1; $i <= CustomVariables::getMaxCustomVariables(); $i++) {
+ // Otherwise, set the Custom Variables found in the cookie sent with this request
+ $goal += $visitCustomVariables;
+ $maxCustomVariables = CustomVariables::getMaxCustomVariables();
+
+ for ($i = 1; $i <= $maxCustomVariables; $i++) {
if (isset($visitorInformation['custom_var_k' . $i])
&& strlen($visitorInformation['custom_var_k' . $i])
) {
@@ -239,8 +243,6 @@ class GoalManager
$goal['custom_var_v' . $i] = $visitorInformation['custom_var_v' . $i];
}
}
- // Otherwise, set the Custom Variables found in the cookie sent with this request
- $goal += $visitCustomVariables;
// Attributing the correct Referrer to this conversion.
// Priority order is as follows:
diff --git a/core/Tracker/Request.php b/core/Tracker/Request.php
index 3c217f6921..df551e7d82 100644
--- a/core/Tracker/Request.php
+++ b/core/Tracker/Request.php
@@ -353,10 +353,11 @@ class Request
return array();
}
$customVariables = array();
+ $maxCustomVars = CustomVariables::getMaxCustomVariables();
foreach ($customVar as $id => $keyValue) {
$id = (int)$id;
if ($id < 1
- || $id > CustomVariables::getMaxCustomVariables()
+ || $id > $maxCustomVars
|| count($keyValue) != 2
|| (!is_string($keyValue[0]) && !is_numeric($keyValue[0]))
) {
diff --git a/core/Tracker/Visit.php b/core/Tracker/Visit.php
index 5926e8f1e2..f18c656310 100644
--- a/core/Tracker/Visit.php
+++ b/core/Tracker/Visit.php
@@ -513,7 +513,8 @@ class Visit implements VisitInterface
// Custom Variables copied from Visit in potential later conversion
if (!empty($selectCustomVariables)) {
- for ($i = 1; $i <= CustomVariables::getMaxCustomVariables(); $i++) {
+ $maxCustomVariables = CustomVariables::getMaxCustomVariables();
+ for ($i = 1; $i <= $maxCustomVariables; $i++) {
if (isset($visitRow['custom_var_k' . $i])
&& strlen($visitRow['custom_var_k' . $i])
) {