-
Improvement
-
Resolution: Fixed
-
Minor
-
3.1.1
-
None
-
None
The error_collector class is installed in this method:
https://github.com/phpbb/phpbb/blob/develop-ascraeus/phpBB/phpbb/error_collector.php#L27
However, set_error_handler does not have a second argument to accept an error level. By default this means it will process all errors, ignoring the error_reporting() level set either by phpbb itself or by the user. In particular this is problematic if the user is attempting to suppress E_STRICT errors that any arbitrary function called by a process which invokes the error_collector (such as the custom mailer function) could cause, leading to spam in the error log.
I would suggest either adding a second argument like "E_ALL & ~E_STRICT" or some other approach to allow the user to determine what level of errors should be processed.
------
[EDIT] for posterity...
The patch for this issue creates a constructor parameter for the error_collector class which accepts a mask of PHP error types that the collector should keep. If set to null (default) then the collector will use the value of error_reporting() at the time of the install method being called instead.
If future core files are changed to use this parameter, the value should be a config setting, not a hard-coded value, otherwise the benefit of this patch will be lost.