[ticket/13192] Add method for generating valid user page links based on mod_rewrite
* marc1706/ticket/13192:
[ticket/13192] Add test for app.php in external subfolder
[ticket/13192] Use ltrim() instead of preg_replace()
[ticket/13192] Order test cases consistently
[ticket/13192] Remove app.php on mod rewrite even if app.php is outside root
[ticket/13192] Pass correct parameters and rename method to get_valid_page
[ticket/13192] Use get_valid_user_page in confirm_box() and cleanup globals
[ticket/13192] Use get_valid_user_page method in build_url function
[ticket/13192] Add method for generating valid user page links
If the current request is a AJAX we need to fix the paths.
We need to get the root path based on the Referer, so we can use
the generated URLs in the template of the Referer. If we do not
generate the relative path based on the Referer, but based on the
currently requested URL, the generated URLs will not point to the
intended locations:
Referer desired URL desired relative root path
memberlist.php faq.php ./
memberlist.php app.php/foo/bar ./
app.php/foo memberlist.php ../
app.php/foo app.php/fox ../
app.php/foo/bar memberlist.php ../../
../page.php memberlist.php ./phpBB/
../sub/page.php memberlist.php ./../phpBB/
PHPBB3-12099
* nickvergessen/ticket/12099:
[ticket/12099] Fix correction in path_helper test
[ticket/12099] Prepend ./ to path to fix assets
[ticket/12099] Deduplicate path generation
[ticket/12099] Fix clean_path() ".." stripping when previous directory was "."
[ticket/12099] Break clean_path tests with a simple test
[ticket/12099] Clean paths in tests
[ticket/12099] Correctly fix go back to root before prepending the root path
[ticket/12099] Clean some paths before using them
[ticket/12099] Fix several issues in path_helper test
The symfony routing component allows us to use the path "/" for routes.
Therefore, we should be able to use example.com/app.php/ for controllers.
However, this currently does not properly work. The method get_web_root_path
incorrectly returns phpbb_root_path. Therefore, paths to images or files are
broken.
PHPBB3-12004
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