From 28e1e8b912721898857d74961536d212709d1496 Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 8 Sep 2002 15:39:44 +0000 Subject: [PATCH] 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. --- mod/forum/lib.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 2f27c45c58..08e9f0fba5 100644 --- a/mod/forum/lib.php +++ b/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"); + } } } -- 2.39.5