From cabc862ee5246afed90102c60bd23b9d9b4dd5df Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Fri, 5 Apr 2024 17:35:28 +0200 Subject: [PATCH] fix --- libs/sysplugins/smarty_internal_templatecompilerbase.php | 2 +- .../_Issues/ArgumentMustBePassedByReference961Test.php | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index d7b6bac28..f5d2c4389 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -643,7 +643,7 @@ public function compilePHPFunctionCall($name, $parameter) if ( !$this->smarty->loadPlugin('smarty_modifiercompiler_' . $name) - && !$this->getPlugin($name, Smarty::PLUGIN_MODIFIER) + && !isset($this->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][$name]) && !in_array($name, ['time', 'join', 'is_array', 'in_array']) ) { trigger_error('Using unregistered function "' . $name . '" in a template is deprecated and will be ' . diff --git a/tests/UnitTests/TemplateSource/_Issues/ArgumentMustBePassedByReference961Test.php b/tests/UnitTests/TemplateSource/_Issues/ArgumentMustBePassedByReference961Test.php index f17a66a52..a637d76d4 100644 --- a/tests/UnitTests/TemplateSource/_Issues/ArgumentMustBePassedByReference961Test.php +++ b/tests/UnitTests/TemplateSource/_Issues/ArgumentMustBePassedByReference961Test.php @@ -25,11 +25,6 @@ public function testReset() public function testResetAsModifier() { $smarty = new Smarty(); - -// $previousErrorReporting = $smarty->error_reporting; -// $smarty->setErrorReporting($previousErrorReporting | E_USER_DEPRECATED); -// $smarty->registerPlugin('modifier', 'reset', 'reset'); -// $this->expectDeprecation(); try { $templateStr = "string:{\$ar|reset}"; $smarty->assign('ar', [1,2,3]); @@ -39,8 +34,6 @@ public function testResetAsModifier() ); } catch (Exception $e) { } - -// $smarty->setErrorReporting($previousErrorReporting); } /**