aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorDavid King <imkingdavid@gmail.com>2013-08-31 14:31:50 -0700
committerDavid King <imkingdavid@gmail.com>2013-08-31 14:31:50 -0700
commitffee476047a996c1a138bd0050826a7a45c01a94 (patch)
treefd9a2aab59a5e9cdba16d0710d5f7fed044e0cb5 /phpBB/includes/functions.php
parentaf1eb7466f11cdb0f851acfcacd957267e20e3ce (diff)
downloadforums-ffee476047a996c1a138bd0050826a7a45c01a94.tar
forums-ffee476047a996c1a138bd0050826a7a45c01a94.tar.gz
forums-ffee476047a996c1a138bd0050826a7a45c01a94.tar.bz2
forums-ffee476047a996c1a138bd0050826a7a45c01a94.tar.xz
forums-ffee476047a996c1a138bd0050826a7a45c01a94.zip
[ticket/11215] Everything appears to be working...
PHPBB3-11215
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php28
1 files changed, 9 insertions, 19 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 428dcfec4a..d85606944f 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2413,7 +2413,7 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
{
global $_SID, $_EXTRA_URL, $phpbb_hook;
global $phpbb_dispatcher;
- global $symfony_request;
+ global $symfony_request, $phpbb_root_path;
if ($params === '' || (is_array($params) && empty($params)))
{
@@ -2421,10 +2421,10 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
$params = false;
}
- $corrected_root = $symfony_request !== null ? phpbb_get_web_root_path($symfony_request) : '';
- if ($corrected_root)
+ $corrected_path = $symfony_request !== null ? phpbb_get_web_root_path($symfony_request, $phpbb_root_path) : '';
+ if ($corrected_path)
{
- $url = $corrected_root . substr($url, strlen($phpbb_root_path));
+ $url = substr($corrected_path . $url, strlen($phpbb_root_path));
}
$append_sid_overwrite = false;
@@ -5218,7 +5218,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
// This path is sent with the base template paths in the assign_vars()
// call below. We need to correct it in case we are accessing from a
// controller because the web paths will be incorrect otherwise.
- $corrected_path = $symfony_request !== null ? phpbb_get_web_root_path($symfony_request) : '';
+ $corrected_path = $symfony_request !== null ? phpbb_get_web_root_path($symfony_request, $phpbb_root_path) : '';
$web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $corrected_path;
// Send a proper content-language to the output
@@ -5731,7 +5731,7 @@ function phpbb_create_symfony_request(phpbb_request $request)
*
* @param Request $symfony_request Symfony Request object
*/
-function phpbb_get_web_root_path(Request $symfony_request)
+function phpbb_get_web_root_path(Request $symfony_request, $phpbb_root_path = '')
{
static $path;
if (null !== $path)
@@ -5740,23 +5740,13 @@ function phpbb_get_web_root_path(Request $symfony_request)
}
$path_info = $symfony_request->getPathInfo();
-
- // When no path is given (i.e. REQUEST_URI = "./app.php") path info from
- // the Symfony Request object is "/". However, that is the same as when
- // the REQUEST_URI is "./app.php/". So we want to correct the path when
- // we have a trailing slash in the REQUEST_URI, but not when we don't.
- $request_uri = $symfony_request->server->get('REQUEST_URI');
- $trailing_slash = substr($request_uri, -1) === '/';
-
- // If pathinfo is / and we do not have a trailing slash in the REQUEST_URI
- if (!$trailing_slash && '/' === $path_info)
+ if ($path_info === '/')
{
- $path = '';
+ $path = $phpbb_root_path;
return $path;
}
$corrections = substr_count($path_info, '/');
- $path = str_repeat('../', $corrections);
-
+ $path = $phpbb_root_path . str_repeat('../', $corrections);
return $path;
}