-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
PhpOffice\PhpWord\Element\AbstractContainer error suppression #468
Comments
…ss error as we check if indexes exists. This fixes issues with error listeners getting triggered on suppressed errors. Addresses issue PHPOffice#468
Yeah, if you use set_error_handler() then you should also read the remark about it bypassing error_reporting() completely. This is not PHPWord at fault with error suppression, this is your custom error handling ignoring the error level. Fix your code: if (!(error_reporting() & $errno)) {
return;
} |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
In AbstractContainer.php on line 101 right now there is the following:
The issue is if a user has listeners for warnings/errors that they will still get the error which then can cause their scripts to send extra alert emails. Switching this to the following would have the same affect, just never produce the warnings to the listeners:
I'll submit a PR with the full fix. While this does have a few more lines of code, it will allow error monitoring to continue without false positives.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: