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 <tsteur@users.noreply.github.com>2014-11-24 22:53:39 +0300
committerThomas Steur <tsteur@users.noreply.github.com>2014-11-24 22:53:39 +0300
commitd3de7b6e8214803917864cc8b1ee65983d25b423 (patch)
treeb0358c905278e3883f66df7088b5a9180eae9cc2 /core/Common.php
parenta8917239df8ef46312c5295f8a92070f87125f86 (diff)
do not lose value in case it is an integer or a float. Instead convert it to a string.
Eg this returned the default value in the past: `Common::getRequestVar('param', 'string', 'default', array('param' => 5))` which can happen eg in BulkTracking etc. causing many values not to be tracked. Wondering if it breaks anything.
Diffstat (limited to 'core/Common.php')
-rw-r--r--core/Common.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/Common.php b/core/Common.php
index 9bb4108739..b5ed581d82 100644
--- a/core/Common.php
+++ b/core/Common.php
@@ -471,7 +471,13 @@ class Common
$ok = false;
if ($varType === 'string') {
- if (is_string($value)) $ok = true;
+ if (is_string($value) || is_int($value)) {
+ $ok = true;
+ } else if (is_float($value)) {
+ $value = Common::forceDotAsSeparatorForDecimalPoint($value);
+ $ok = true;
+ }
+
} elseif ($varType === 'integer') {
if ($value == (string)(int)$value) $ok = true;
} elseif ($varType === 'float') {