Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MDL-25176 forum Redirects for new discussions shouldn't use SESSION
[moodle.git]
/
mod
/
forum
/
post.php
diff --git
a/mod/forum/post.php
b/mod/forum/post.php
index
6f39445
..
e3d3dec
100644
(file)
--- a/
mod/forum/post.php
+++ b/
mod/forum/post.php
@@
-152,7
+152,8
@@
if (!empty($forum)) { // User is starting a new discussion in a forum
$post->groupid = groups_get_activity_group($cm);
}
$post->groupid = groups_get_activity_group($cm);
}
- forum_set_return();
+ // Unsetting this will allow the correct return URL to be calculated later.
+ unset($SESSION->fromdiscussion);
} else if (!empty($reply)) { // User is writing a new reply
} else if (!empty($reply)) { // User is writing a new reply
@@
-227,6
+228,7
@@
if (!empty($forum)) { // User is starting a new discussion in a forum
$post->subject = $strre.' '.$post->subject;
}
$post->subject = $strre.' '.$post->subject;
}
+ // Unsetting this will allow the correct return URL to be calculated later.
unset($SESSION->fromdiscussion);
} else if (!empty($edit)) { // User is editing their own post
unset($SESSION->fromdiscussion);
} else if (!empty($edit)) { // User is editing their own post
@@
-277,9
+279,9
@@
if (!empty($forum)) { // User is starting a new discussion in a forum
$post = trusttext_pre_edit($post, 'message', $modcontext);
$post = trusttext_pre_edit($post, 'message', $modcontext);
+ // Unsetting this will allow the correct return URL to be calculated later.
unset($SESSION->fromdiscussion);
unset($SESSION->fromdiscussion);
-
}else if (!empty($delete)) { // User is deleting a post
if (! $post = forum_get_post_full($delete)) {
}else if (!empty($delete)) { // User is deleting a post
if (! $post = forum_get_post_full($delete)) {