Fix error handler allowUndefinedVars

This commit is contained in:
Rudie Dirkx
2022-02-18 23:40:18 +01:00
committed by GitHub
parent 8aeb5d6821
commit 2235eb218f

View File

@@ -66,7 +66,7 @@ class Smarty_Internal_ErrorHandler
*/ */
public function handleError($errno, $errstr, $errfile, $errline, $errcontext = []) public function handleError($errno, $errstr, $errfile, $errline, $errcontext = [])
{ {
if ($this->allowUndefinedVars && $errstr == 'Attempt to read property "value" on null') { if ($this->allowUndefinedVars && preg_match('/^Attempt to read property ".+?" on null$/', $errstr)) {
return; // suppresses this error return; // suppresses this error
} }