mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-78505 Revert "MDL-32114 form: markdown must be preserved on saving post"
This partially reverts commit 4a31dd69d6d89818f676ece916e573aa894d49d6.
This commit is contained in:
parent
478abd671f
commit
a50c2d4746
@ -1376,8 +1376,9 @@ function format_text($text, $format = FORMAT_MOODLE, $options = null, $courseidd
|
||||
$text = markdown_to_html($text);
|
||||
$filteroptions['stage'] = 'pre_clean';
|
||||
$text = $filtermanager->filter_text($text, $context, $filteroptions);
|
||||
// The markdown parser does not strip dangerous html so we need to clean it, even if noclean is set to true.
|
||||
$text = clean_text($text, FORMAT_HTML, $options);
|
||||
if (!$options['noclean']) {
|
||||
$text = clean_text($text, FORMAT_HTML, $options);
|
||||
}
|
||||
$filteroptions['stage'] = 'post_clean';
|
||||
$text = $filtermanager->filter_text($text, $context, $filteroptions);
|
||||
break;
|
||||
|
@ -346,10 +346,7 @@ if (!empty($forum)) {
|
||||
$canreplyprivately = forum_user_can_reply_privately($modcontext, $parent);
|
||||
}
|
||||
|
||||
// If markdown is used, the parser does the job already, otherwise clean text from arbitrary code that might be dangerous.
|
||||
if ($post->messageformat != FORMAT_MARKDOWN) {
|
||||
$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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user