Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-13306

Add error level to the error collector


    • Type: Improvement
    • Status: Unverified Fix (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.1
    • Fix Version/s: 3.1.3-RC1
    • Component/s: None
    • Labels:


      The error_collector class is installed in this method:

      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.




            • Assignee:
              nickvergessen Joas Schilling [X] (Inactive)
              omniError omniError [X] (Inactive)
            • Votes:
              0 Vote for this issue
              2 Start watching this issue


              • Created: