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:
authordiosmosis <diosmosis@users.noreply.github.com>2020-01-03 05:30:23 +0300
committerGitHub <noreply@github.com>2020-01-03 05:30:23 +0300
commit3f760fec68332962b3647167df18317fc759482d (patch)
tree64c1991fb81590a7aa12bf7f5843416e191b227d /core
parent7a371a057a46f4fc0ec3ead1c4c9b394aa542a40 (diff)
Compute row percentages in PHP before metrics are formatted to avoid percentage formatting WARNINGS. (#15304)
* Compute row percentages in PHP before metrics are formatted to avoid percentage formatting WARNINGS. * do not fail if site summary is not available * Make sure siteSummary requests total data without segment. * Make sure proper precision is used. * try to fix tests * update expected screenshots
Diffstat (limited to 'core')
-rw-r--r--core/Twig.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/Twig.php b/core/Twig.php
index b8b92f283e..afb6a1cdc2 100644
--- a/core/Twig.php
+++ b/core/Twig.php
@@ -198,6 +198,7 @@ class Twig
$this->addTest_false();
$this->addTest_true();
$this->addTest_emptyString();
+ $this->addTest_isNumeric();
$this->twig->addExtension(new PiwikTwigFilterExtension());
}
@@ -575,4 +576,15 @@ class Twig
});
$this->twig->addFilter($safelink);
}
+
+ private function addTest_isNumeric()
+ {
+ $test = new Twig_SimpleTest(
+ 'numeric',
+ function ($value) {
+ return is_numeric($value);
+ }
+ );
+ $this->twig->addTest($test);
+ }
}