Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-14794

Fix redirect behavior in according to parse_url() behavior changes in PHP 7.1+

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.2.0-RC2
    • 3.2.0-dev, 4.0.0-a1
    • Viewing posts
    • None

      Regarding remaining failures, in PHP 7.1+ parse_url() was changed to be more restrictive and supports RFC3986 now, so it just returns false on urls like http://localhost.foobar.com\\@localhost/troll/http://localhost/ (from our tests). That's why tests fail on expecting exceptions from ```redirect()``` because ```redirect()``` returns url to index page.
      We might want to throw exception in that case as well for consistency instead of redirecting to the same page here https://github.com/phpbb/phpbb/blob/master/phpBB/includes/functions.php#L1712-L1716

      This will fix tests on PHP 7.1 and PHP nightly builds.

      parse_url() output in PHP 7.1+ and older versions (see screenshot).

            Marc Marc
            rxu rxu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: