Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handler should only allow notices etc in smarty templates, not beyond #839

Open
rudiedirkx opened this issue Jan 5, 2023 · 1 comment

Comments

@rudiedirkx
Copy link

If the error handler allow properties are true (default), Smarty catches ALL notices (in short) for ALL code that STARTS in a Smarty template. That's a bit too much. This notice should be caught like now:

{{$nonExistingVar}}

That throws an Undefined array key from 24555ff3ba201974a27652ea2c61a898c2df0cb8_0.file.bla.tpl and we want to catch that. That's good.

But this one should NOT be caught by the Smarty error handler:

{{$existingObject->existingMethod()}}

function existingMethod() {
    return $this->existingArray['nonExistingKey'];
}

That also throws an Undefined array key, but NOT from compiled template code. But Smarty catches and suppresses it anyway. I don't think that's what we want.

Can Smarty_Internal_ErrorHandler::handleError() check for the source of the error? If it's not a smarty compiled template file, let it through.

@rudiedirkx
Copy link
Author

See #840

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants