Skip to content

Commit

Permalink
[bug/58755] Fix a redirection bug that can occur after login
Browse files Browse the repository at this point in the history
This issue affects any forum (i.e. https://myforum/phpBB3/) where:
 - the forum is located in a directory underneath the web root (i.e., NOT https://myforum/)
 - a user accesses the forum with a URI pointing to a directory rather than a script (i.e., NOT https://myforum/phpBB3/index.php)
 - the URI used ends in a slash (i.e., NOT https://myforum/phpBB3)

If these conditions are met, after successful login the user is redirected to an invalid URI (i.e., https://myforum/phpBB3/phpBB3?sid=).

This change fixes extract_current_page() to handle the case correctly where the URI ends in a slash and is not the web root. So after successful login, the redirection back to the main page will work (i.e., https://myforum/phpBB3/?sid=)
  • Loading branch information
dpward committed Mar 7, 2010
1 parent 568fb83 commit 865123f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phpBB/includes/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function extract_current_page($root_path)
$query_string = trim(implode('&', $use_args));

// basenamed page name (for example: index.php)
$page_name = basename($script_name);
$page_name = (substr($script_name, -1, 1) == '/') ? '' : basename($script_name);
$page_name = urlencode(htmlspecialchars($page_name));

// current directory within the phpBB root (for example: adm)
Expand Down

0 comments on commit 865123f

Please sign in to comment.