From 4f5cda954a6b64677f9b48223a91e0ec8785e055 Mon Sep 17 00:00:00 2001 From: Stefan Giehl Date: Tue, 7 Dec 2021 20:44:01 +0100 Subject: Fix 'Call to undefined function Piwik\piwik_fix_lbrace()' (#18461) --- core/Twig.php | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'core/Twig.php') diff --git a/core/Twig.php b/core/Twig.php index e5b5e24958..abf3549af2 100644 --- a/core/Twig.php +++ b/core/Twig.php @@ -42,26 +42,7 @@ function piwik_format_number($string, $minFractionDigits, $maxFractionDigits) function piwik_fix_lbrace($string) { - $chars = array('{', '{', '{', '{', '{', '{'); - - static $search; - static $replace; - - if (!isset($search)) { - $search = array_map(function ($val) { return $val . $val; }, $chars); - } - if (!isset($replace)) { - $replace = array_map(function ($val) { return $val . '⁣' . $val; }, $chars); - } - - $replacedString = is_null($string) ? $string : str_replace($search, $replace, $string); - - // try to replace characters until there are no changes - if ($string !== $replacedString) { - return piwik_fix_lbrace($replacedString); - } - - return $string; + return Common::fixLbrace($string); } function piwik_escape_filter(Environment $env, $string, $strategy = 'html', $charset = null, $autoescape = false) { -- cgit v1.2.3