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

Replace ^ with &~ in error_reporting calls

    Details

    • Type: Improvement
    • Status: Unverified Fix
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.0.8
    • Fix Version/s: 3.0.9-RC1
    • Component/s: None
    • Labels:
      None

      Description

      Using xor in error reporting setup is evil.

      phpBB/common.php:error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);

      There are other locations as well.

        Activity

        Hide
        naderman Nils Adermann added a comment -

        Why?

        Show
        naderman Nils Adermann added a comment - Why?
        Hide
        bantu Andreas Fischer added a comment -

        Bump

        Show
        bantu Andreas Fischer added a comment - Bump
        Hide
        Oleg Oleg [X] (Inactive) added a comment -

        Because what is wanted is &~. ^ is a micro-optimization and it does not matter. If php ever changes the meaning of E_ALL, which it has in the past, this code will break. If someone follows the logic and adds ^ E_NOTICE it can also break.

        &~ is what is wanted therefore that is what should be written.

        Show
        Oleg Oleg [X] (Inactive) added a comment - Because what is wanted is &~. ^ is a micro-optimization and it does not matter. If php ever changes the meaning of E_ALL, which it has in the past, this code will break. If someone follows the logic and adds ^ E_NOTICE it can also break. &~ is what is wanted therefore that is what should be written.
        Hide
        bantu Andreas Fischer added a comment -

        All affected files have been already touched except style.php.

        Show
        bantu Andreas Fischer added a comment - All affected files have been already touched except style.php.

          People

          • Assignee:
            bantu Andreas Fischer
            Reporter:
            Oleg Oleg [X] (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development