Skip to content
Browse files

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...
1 parent cdf6a3c commit 28e1e8b912721898857d74961536d212709d1496 martin committed Sep 8, 2002
Showing with 7 additions and 4 deletions.
  1. +7 −4 mod/forum/lib.php
View
11 mod/forum/lib.php
@@ -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");
+ }
}
}

0 comments on commit 28e1e8b

Please sign in to comment.
Something went wrong with that request. Please try again.