From 0bd0e4b1ff36b054ce1d9340942c45beeb0cf959 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 4 Dec 2017 12:24:49 +0100 Subject: [inc/Render] Fix lang_ matching regexp (spaces) --- inc/render.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'inc/render.inc.php') diff --git a/inc/render.inc.php b/inc/render.inc.php index 13262c1d..d09b2a8e 100644 --- a/inc/render.inc.php +++ b/inc/render.inc.php @@ -224,15 +224,15 @@ class Render $params = array(); } // Now find all language tags in this array - if (preg_match_all('/{{(lang_.+?)}}/', $html, $out) > 0) { + if (preg_match_all('/{{\s*(lang_.+?)\s*}}/', $html, $out) > 0) { $dictionary = Dictionary::getArray($module, 'template-tags'); $fallback = false; foreach ($out[1] as $tag) { - // Add untranslated strings to the dictionary, so their tag is seen in the rendered page if ($fallback === false && empty($dictionary[$tag])) { - $fallback = true; // Fallback to general dictionary of module + $fallback = true; // Fallback to general dictionary of main module $dictionary = $dictionary + Dictionary::getArray('main', 'global-tags'); } + // Add untranslated strings to the dictionary, so their tag is seen in the rendered page if (empty($dictionary[$tag])) { $dictionary[$tag] = '{{' . $tag . '}}'; } -- cgit v1.2.3-55-g7522