[ticket/11997] Correctly redirect to front controllers

We currently do a lot of checks in order to prevent users from getting to
a 404 page. However, this logic relies on checking if a file or folder exists.
Due to the front controllers and the URL rewriting in 3.1, it is no longer
possible to rely on existing files for redirecting. This patch will take
care of properly redirecting users to front controller files. An incorrect
link will cause users to get a 404 error though.

PHPBB3-11997
[ticket/11997] Remove obsolete if statement in phpbb_own_realpath()

PHPBB3-11997
[ticket/11997] Rename root_dirs_size to superordinate_dirs_count

This variable name better fits what is done with it. A comment explaining
why 2 has to be subtracted from the size of root_dirs has also been added

PHPBB3-11997
[ticket/11997] Use $phpbb_filesystem->clean_path() for proper redirect paths

PHPBB3-11997
[ticket/11997] Fix redirects from inside controllers

The redirect url currently uses the web root path. However as we prepend the
full board url later, we need to remove the relative web root path and prepend
the normal root path again. Otherwise redirects from inside routes will not
work as intended.

PHPBB3-11997
[ticket/11997] Fix missing global

PHPBB3-11997
[ticket/11997] Add functional test for redirects in controller

PHPBB3-11997
Merge pull request #4 from nickvergessen/ticket/marc/11997

Ticket/marc/11997
[ticket/11997] Remove obsolete failover_flag in function redirect()

This flag is no longer needed as the failover is no longer needed.

PHPBB3-11997
[ticket/11997] Undo changes to phpbb_own_realpath()

PHPBB3-11997
[ticket/11997] Add method for controller redirect URLs to path helper

This method will allow us to get proper redirect URLs for controllers.

PHPBB3-11997
[ticket/11997] Use get_controller_redirect_url() in redirect() function

This method of path_helper will now be used instead of the previous hack
of the phpbb_own_realpath() function.

PHPBB3-11997
[ticket/11997] Fix tests for path_helper's get_controller_redirect_url()

PHPBB3-11997
Merge branch 'develop' of https://github.com/phpbb/phpbb into ticket/11997

Conflicts:
	tests/functional/fixtures/ext/foo/bar/config/services.yml
[ticket/11997] Move expected redirect returns to controller and output to HTML

The controller will now output the expected redirect returns the same way the
redirect returns are output. The extension controller test will compare those
2 outputs.

PHPBB3-11997
[ticket/11997] Allow redirects to parent folders like previously

Redirects to parent folders were possible with the previous redirect function.
This change will allow these redirects again.

PHPBB3-11997
[ticket/11997] Add clean_url() method to path_helper

This method will get rid of unnecessary . and .. in URLs.

PHPBB3-11997
[ticket/11997] Modifiy tests after adding path_helper clean_url method

PHPBB3-11997
[ticket/11997] Do not check if file or dir we redirect to exist

The redirect function will now properly redirect to where we want it to.
It will no longer try to check if the file or directory we redirect to exist.
This will ensure compatibility with the new routes.

PHPBB3-11997
[ticket/11997] Add remove_web_root_path() in order to prevent incorrect URLs

Adding a call to this method to the redirect function will make sure that we
do not end up with incorrect URLs after using append_sid().

PHPBB3-11997