Ticket #743 (fixed bug)
Login from viewtopic.php?pid=XXX#pXXX
- Created: 2012-09-25 22:12:52
- Reported by: nightware
- Assigned to: quy
- Milestone: 1.5.1
- Component: code
- Priority: normal
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:
$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;
$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');
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
- Milestone set to 1.5.1.
- Owner set to quy.
- Status changed from open to fixed.