From 64e0ce1fe58c61af7185f8de5c0cb5f15a2450da Mon Sep 17 00:00:00 2001 From: Aamir Bashir Date: Thu, 2 Feb 2023 12:16:50 +0530 Subject: [PATCH] Fixing the warning of unintialized variables in php 8.1 --- libs/sysplugins/smarty_internal_templatecompilerbase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index d5c18d31a..323cc764d 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -574,7 +574,7 @@ public function compileVariable($variable) )->nocache; // todo $this->template->compiled->properties['variables'][$var] = $this->tag_nocache | $this->nocache; } - return '$_smarty_tpl->tpl_vars[' . $variable . ']->value'; + return '($_smarty_tpl->tpl_vars[' . $variable . ']->value ?? NULL)'; } /**