aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions.php')
-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,