From 95c9364a606bb32f9454057faa6bc5a20d119504 Mon Sep 17 00:00:00 2001 From: Yury Pikhtarev Date: Sat, 21 Jun 2025 23:07:07 +0400 Subject: [PATCH] fix(template): handle L_ variables in template vars when not found in lang vars Template variables starting with L_ (like L_MY_PROFILE) are now properly resolved when they exist in template variables but not in language variables. Previously, these would fall back to showing the literal variable name. The L_ variable regex now checks both $L (language) and $V (template) arrays before falling back to the literal string, maintaining backward compatibility while fixing composite language variables set via template assignment. --- src/Legacy/Template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Legacy/Template.php b/src/Legacy/Template.php index c5acceeeb..957015d18 100644 --- a/src/Legacy/Template.php +++ b/src/Legacy/Template.php @@ -767,7 +767,7 @@ class Template } // This will handle the remaining root-level varrefs // Handle L_ language variables specifically - show plain text when not found - $code = preg_replace('#\{(L_([a-z0-9\-_]+?))\}#i', '', $code); + $code = preg_replace('#\{(L_([a-z0-9\-_]+?))\}#i', '', $code); // Handle PHP variables $code = preg_replace('#\{(\$[a-z_][a-z0-9_$\->\'\"\.\[\]]*?)\}#i', '', $code); // Handle constants