aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/controller
diff options
context:
space:
mode:
authorDavid King <imkingdavid@gmail.com>2013-09-03 16:16:23 -0700
committerDavid King <imkingdavid@gmail.com>2013-09-03 16:57:27 -0700
commit010da72f64ce325c27fb68c5c142ec01e1e53e61 (patch)
tree7c954f78fb62acf405165ffcda6a55e257eda279 /phpBB/phpbb/controller
parent8d6b03c438392cebed941491684ff835bf7136a8 (diff)
downloadforums-010da72f64ce325c27fb68c5c142ec01e1e53e61.tar
forums-010da72f64ce325c27fb68c5c142ec01e1e53e61.tar.gz
forums-010da72f64ce325c27fb68c5c142ec01e1e53e61.tar.bz2
forums-010da72f64ce325c27fb68c5c142ec01e1e53e61.tar.xz
forums-010da72f64ce325c27fb68c5c142ec01e1e53e61.zip
[ticket/11824] Add option for mod_rewrite
PHPBB3-11824
Diffstat (limited to 'phpBB/phpbb/controller')
-rw-r--r--phpBB/phpbb/controller/helper.php22
1 files changed, 10 insertions, 12 deletions
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php
index 4d240f9380..3f6ef24ce0 100644
--- a/phpBB/phpbb/controller/helper.php
+++ b/phpBB/phpbb/controller/helper.php
@@ -36,10 +36,10 @@ class phpbb_controller_helper
protected $user;
/**
- * Request object
- * @var phpbb_request
+ * config object
+ * @var phpbb_config
*/
- protected $request;
+ protected $config;
/**
* phpBB root path
@@ -61,11 +61,11 @@ class phpbb_controller_helper
* @param string $phpbb_root_path phpBB root path
* @param string $php_ext PHP extension
*/
- public function __construct(phpbb_template $template, phpbb_user $user, phpbb_request_interface $request, $phpbb_root_path, $php_ext)
+ public function __construct(phpbb_template $template, phpbb_user $user, phpbb_config $config, $phpbb_root_path, $php_ext)
{
$this->template = $template;
$this->user = $user;
- $this->request = $request;
+ $this->config = $config;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
}
@@ -109,14 +109,12 @@ class phpbb_controller_helper
$route = substr($route, 0, $route_delim);
}
- $request_uri = $this->request->variable('REQUEST_URI', '', false, phpbb_request::SERVER);
- $script_name = $this->request->variable('SCRIPT_NAME', '', false, phpbb_request::SERVER);
-
- // If the app.php file is being used (no rewrite) keep it in the URL.
- // Otherwise, don't include it.
+ // If enable_mod_rewrite is false, we not need to include app.php
$route_prefix = $this->phpbb_root_path;
- $parts = explode('/', $script_name);
- $route_prefix .= strpos($request_uri, $script_name) === 0 ? array_pop($parts) . '/' : '';
+ if (empty($this->config['enable_mod_rewrite']))
+ {
+ $route_prefix .= 'app.' . $this->php_ext . '/';
+ }
return append_sid($route_prefix . "$route" . $route_params, $params, $is_amp, $session_id);
}