aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2014-03-12 18:48:41 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2014-03-12 18:48:41 -0500
commitd69012ea6d65e938a72f7accca498fc9feb2df0d (patch)
treef18aa896ab7be6889f3860edc157cd8a3146cc6a /phpBB
parentc6a87e77d4e11bd9e2e47e20c96fee66892c04b0 (diff)
parente07f3141179da9943ed51e754f15912dd24f4aff (diff)
downloadforums-d69012ea6d65e938a72f7accca498fc9feb2df0d.tar
forums-d69012ea6d65e938a72f7accca498fc9feb2df0d.tar.gz
forums-d69012ea6d65e938a72f7accca498fc9feb2df0d.tar.bz2
forums-d69012ea6d65e938a72f7accca498fc9feb2df0d.tar.xz
forums-d69012ea6d65e938a72f7accca498fc9feb2df0d.zip
Merge pull request #2104 from nickvergessen/ticket/12261
[ticket/12261] Remove web root path from login redirect url
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 03cd235f86..5e5f508b6b 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2344,7 +2344,7 @@ function reapply_sid($url)
*/
function build_url($strip_vars = false)
{
- global $user, $phpbb_root_path;
+ global $config, $user, $phpEx, $phpbb_root_path;
$page = $user->page['page'];
@@ -2357,6 +2357,12 @@ function build_url($strip_vars = false)
// URL
if ($url_parts === false || empty($url_parts['scheme']) || empty($url_parts['host']))
{
+ // Remove 'app.php/' from the page, when rewrite is enabled
+ if ($config['enable_mod_rewrite'] && strpos($page, 'app.' . $phpEx . '/') === 0)
+ {
+ $page = substr($page, strlen('app.' . $phpEx . '/'));
+ }
+
$page = $phpbb_root_path . $page;
}
@@ -4902,7 +4908,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'S_TOPIC_ID' => $topic_id,
'S_LOGIN_ACTION' => ((!defined('ADMIN_START')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("{$phpbb_admin_path}index.$phpEx", false, true, $user->session_id)),
- 'S_LOGIN_REDIRECT' => build_hidden_fields(array('redirect' => build_url())),
+ 'S_LOGIN_REDIRECT' => build_hidden_fields(array('redirect' => $phpbb_path_helper->remove_web_root_path(build_url()))),
'S_ENABLE_FEEDS' => ($config['feed_enable']) ? true : false,
'S_ENABLE_FEEDS_OVERALL' => ($config['feed_overall']) ? true : false,