diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-05-09 01:24:23 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-05-09 01:24:23 +0400 |
commit | f5ba79b389d85c49abbf17accb41a33904060d36 (patch) | |
tree | 1620c62caf5a63007c920b95c2fa9eb718eddbd9 /core/Twig.php | |
parent | 577d91a984e0b3b57526adbe1c7ad987941c3736 (diff) |
fixes #4749 Apostrpohes (and maybe other special characters) were shown encoded in page tooltip
Diffstat (limited to 'core/Twig.php')
-rw-r--r-- | core/Twig.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/Twig.php b/core/Twig.php index 16348e524c..a560daa2ce 100644 --- a/core/Twig.php +++ b/core/Twig.php @@ -9,6 +9,7 @@ namespace Piwik; use Exception; +use Piwik\DataTable\Filter\SafeDecodeLabel; use Piwik\Period\Range; use Piwik\Translate; use Piwik\Visualization\Sparkline; @@ -65,6 +66,7 @@ class Twig $this->addFilter_notificiation(); $this->addFilter_percentage(); $this->addFilter_prettyDate(); + $this->addFilter_safeDecodeRaw(); $this->twig->addFilter(new Twig_SimpleFilter('implode', 'implode')); $this->twig->addFilter(new Twig_SimpleFilter('ucwords', 'ucwords')); @@ -198,6 +200,15 @@ class Twig $this->twig->addFilter($notificationFunction); } + protected function addFilter_safeDecodeRaw() + { + $rawSafeDecoded = new Twig_SimpleFilter('rawSafeDecoded', function ($string) { + return SafeDecodeLabel::decodeLabelSafe($string); + + }, array('is_safe' => array('all'))); + $this->twig->addFilter($rawSafeDecoded); + } + protected function addFilter_prettyDate() { $prettyDate = new Twig_SimpleFilter('prettyDate', function ($dateString, $period) { |