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

Add error level to the error collector

    XMLWordPrintable

Details

    • Improvement
    • Status: Unverified Fix (View Workflow)
    • Minor
    • Resolution: Fixed
    • 3.1.1
    • 3.1.3-RC1
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: