Skip to content

Login from viewtopic.php?pid=XXX#pXXX #32

Description

@Studio384

Login from viewtopic.php?pid=XXX#pXXX does not redirect you back to the post XXX. This is especially the case, when clicking on links sent by email and then having to login.
As a fix, i propose the following change, as I have done:

if (!isset($redirect_url))
    $redirect_url = 'index.php';
// <add mod_login_redirect_url=v0.1>
if (preg_match('/viewtopic\.php\?pid=(\d+)$/', $redirect_url, $match))
    $redirect_url .= '#p' . $match[1];
// </add>
$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Login']);
$required_fields = array('req_username' => $lang_common['Username'], 'req_password' => $lang_common['Password']);
$focus_element = array('login', 'req_username');
define('PUN_ACTIVE_PAGE', 'login');
require PUN_ROOT.'header.php';

I don't know the exact line, but it should be around 270 in /login.php. This redirects to the according post by detecting the pid-string in the url.

This 'misbehaviour' is orginiated in the fact, that the Referrer does not transfer anchor information ('#pXXX'). Since viewtopic.php?pid= is only used with the anchor, ie. it does not occur without the anchor in the code.

also note, this is not the same, but similar to #681

http://fluxbb.org/development/core/tickets/743/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions