smarty
smarty copied to clipboard
Fix error handler allowUndefinedVars
handleError
only checks for property value
, which is odd. I'm getting error
Attempt to read property "id" on null
Because id
is the property being accessed. So it should check for any property name, not just value
.
This pull request would make it possible to migrate to newer version without a large amount of changes. Could this be merged?
Does nobody have allowUndefinedVars
enabled in PHP 8.0+?
This change seems straightforward. Should be able to merge this. Just to be clear: could you provide an exact issue? I.e. what problem does this solve?
$smarty->assign('object', null);
====
{{$object->name}}
That would trigger a
Attempt to read property "name" on null
I'll fix the merge conflict.
I propose a slightly different implementation, see https://github.com/smarty-php/smarty/pull/832