1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-02 23:07:39 +02:00

Merge pull request #2104 from nickvergessen/ticket/12261

[ticket/12261] Remove web root path from login redirect url
This commit is contained in:
Nathan Guse
2014-03-12 18:48:41 -05:00
5 changed files with 50 additions and 4 deletions

View File

@@ -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,