Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed a bug. When replying to an email copy, you would be forwarded
to the login screen to login first.  However, this was being saved
as the place to go back to after replying.

I added a check for this so now it behaves as you'd expect.
  • Loading branch information
martin committed Sep 8, 2002
1 parent cdf6a3c commit 28e1e8b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions mod/forum/lib.php
Expand Up @@ -413,11 +413,14 @@ function forum_count_unrated_posts($discussionid, $userid) {


function forum_set_return() {
global $SESSION, $HTTP_REFERER;
global $CFG, $SESSION, $HTTP_REFERER;

if (! $SESSION->fromdiscussion) {
$SESSION->fromdiscussion = $HTTP_REFERER;
save_session("SESSION");
if (! isset($SESSION->fromdiscussion)) {
// If the referer is NOT a login screen then save it.
if (! strncasecmp("$CFG->wwwroot/login", $HTTP_REFERER, 300)) {
$SESSION->fromdiscussion = $HTTP_REFERER;
save_session("SESSION");
}
}
}

Expand Down

0 comments on commit 28e1e8b

Please sign in to comment.