aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorDavid King <imkingdavid@gmail.com>2012-11-17 17:48:20 -0500
committerDavid King <imkingdavid@gmail.com>2012-11-17 17:48:20 -0500
commit8913b2c7c4ffc38d4caf34ca7014b8a07f11d19d (patch)
treeedafc0a55ede9c99b0823b2002bef0e4c2c4182e /phpBB
parent4efbb893b7b8ada8766847dc59724faef9c18142 (diff)
downloadforums-8913b2c7c4ffc38d4caf34ca7014b8a07f11d19d.tar
forums-8913b2c7c4ffc38d4caf34ca7014b8a07f11d19d.tar.gz
forums-8913b2c7c4ffc38d4caf34ca7014b8a07f11d19d.tar.bz2
forums-8913b2c7c4ffc38d4caf34ca7014b8a07f11d19d.tar.xz
forums-8913b2c7c4ffc38d4caf34ca7014b8a07f11d19d.zip
[feature/controller] Use query string, not path info, for controller access
This is hopefully just temporary until we can fix the relative path issue. PHPBB3-10864
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/app.php8
-rw-r--r--phpBB/common.php7
-rw-r--r--phpBB/includes/functions.php16
3 files changed, 9 insertions, 22 deletions
diff --git a/phpBB/app.php b/phpBB/app.php
index f1023ff1b5..13bf3f0be1 100644
--- a/phpBB/app.php
+++ b/phpBB/app.php
@@ -7,6 +7,8 @@
*
*/
+use Symfony\Component\HttpFoundation\Request;
+
/**
*/
@@ -24,6 +26,12 @@ $user->session_begin();
$auth->acl($user->data);
$user->setup('app');
+// Until we fix the issue with relative paths, we have to fake path info to
+// allow urls like app.php?controller=foo/bar
+$controller = $request->variable('controller', '', false, phpbb_request_interface::GET);
+$uri = '/' . $controller;
+$symfony_request = Request::create($uri);
+
$http_kernel = $phpbb_container->get('http_kernel');
$response = $http_kernel->handle($symfony_request);
$response->send();
diff --git a/phpBB/common.php b/phpBB/common.php
index a5ffcea8e4..e99b9edee5 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -8,8 +8,6 @@
* Minimum Requirement: PHP 5.3.3
*/
-use Symfony\Component\HttpFoundation\Request;
-
/**
*/
if (!defined('IN_PHPBB'))
@@ -105,11 +103,6 @@ $phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
// set up caching
$cache = $phpbb_container->get('cache');
-// Instantiate the Symfony Request object
-// This must be done before phpbb_request
-// because otherwise globals are disabled
-$symfony_request = Request::createFromGlobals();
-
// Instantiate some basic classes
$phpbb_dispatcher = $phpbb_container->get('dispatcher');
$request = $phpbb_container->get('request');
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 88ce142195..17fc16ef86 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2346,20 +2346,6 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
$params = false;
}
- // Make sure we have a Symfony Request object; tests do not have one
- // unless they need it.
- if ($symfony_request)
- {
- // Correct the path when we are accessing it through a controller
- // This simply rewrites the value given by $phpbb_root_path to the
- // script_path in config.
- $path_info = $symfony_request->getPathInfo();
- if (!empty($path_info) && $path_info != '/')
- {
- $url = $config['script_path'] . '/' . substr($url, strlen($phpbb_root_path));
- }
- }
-
$append_sid_overwrite = false;
/**
@@ -5056,7 +5042,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
// Determine board url - we may need it later
$board_url = generate_board_url() . '/';
- $web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $config['script_path'] . '/';
+ $web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $phpbb_root_path;
// Send a proper content-language to the output
$user_lang = $user->lang['USER_LANG'];