diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2014-11-25 05:18:34 +0300 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2014-11-25 05:18:34 +0300 |
commit | 9210ccc9648cf3ab117c91c1cc7a3c6bf1123eb9 (patch) | |
tree | f8749e5bef7018973708caca188eef9b7f8056ed /core | |
parent | 5a0aa6758d211e104367fc7f9649c11610dbee5a (diff) | |
parent | cb3494c304f537c6b2b15103c0fb485fbebe12d4 (diff) |
Merge pull request #6720 from piwik/getRequestVarTest
Do not use default value in case value is an integer or a float and a string is requested
Diffstat (limited to 'core')
-rw-r--r-- | core/Common.php | 8 |
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') { |