aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/controller
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-09-19 18:58:53 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-09-19 18:58:53 +0200
commitfc252f1ba52760a072d8e79f5afc3268db7d1035 (patch)
treea2f4b15262c615d16ea398dd69ce16b6788c53f5 /phpBB/phpbb/controller
parent98f02ece97cd92de6f71632247a439a1ba25a408 (diff)
parent3418683cfcfd99235c680e28c60f066c3b36915a (diff)
downloadforums-fc252f1ba52760a072d8e79f5afc3268db7d1035.tar
forums-fc252f1ba52760a072d8e79f5afc3268db7d1035.tar.gz
forums-fc252f1ba52760a072d8e79f5afc3268db7d1035.tar.bz2
forums-fc252f1ba52760a072d8e79f5afc3268db7d1035.tar.xz
forums-fc252f1ba52760a072d8e79f5afc3268db7d1035.zip
Merge pull request #2969 from marc1706/ticket/13073
[ticket/13073] Correctly generate routes from subfolders like /adm * marc1706/ticket/13073: [ticket/13073] Remove _test suffix from common test class [ticket/13073] Switch $input with $expected and add paths with letters [ticket/13073] Use abstract class for controller helper route tests [ticket/13073] Add path regex to get_preg_expression() and add unit tests [ticket/13073] Use just one regex in helper route() [ticket/13073] Properly place comments in helper [ticket/13073] Use correct class names in test files [ticket/13073] Rework route tests and add tests for more directory types [ticket/13073] Test that routes from subfolders like /adm work [ticket/13073] Add tests for routes from adm pages [ticket/13073] Add phpbb root path with mod rewrite enabled for proper routes
Diffstat (limited to 'phpBB/phpbb/controller')
-rw-r--r--phpBB/phpbb/controller/helper.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php
index e2932086db..fc19b855c0 100644
--- a/phpBB/phpbb/controller/helper.php
+++ b/phpBB/phpbb/controller/helper.php
@@ -140,8 +140,15 @@ class helper
// If enable_mod_rewrite is false we need to replace the current front-end by app.php, otherwise we need to remove it.
$base_url = str_replace('/' . $page_name, empty($this->config['enable_mod_rewrite']) ? '/app.' . $this->php_ext : '', $base_url);
- // We need to update the base url to move to the directory of the app.php file.
- $base_url = str_replace('/app.' . $this->php_ext, '/' . $this->phpbb_root_path . 'app.' . $this->php_ext, $base_url);
+ // We need to update the base url to move to the directory of the app.php file
+ if (empty($this->config['enable_mod_rewrite']))
+ {
+ $base_url = str_replace('/app.' . $this->php_ext, '/' . $this->phpbb_root_path . 'app.' . $this->php_ext, $base_url);
+ }
+ else
+ {
+ $base_url .= preg_replace(get_preg_expression('path_remove_dot_trailing_slash'), '$2', $this->phpbb_root_path);
+ }
$base_url = $this->filesystem->clean_path($base_url);