diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 8da6ce80253..c6dbfb98885 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -2208,7 +2208,11 @@ function forum_print_post(&$post, $courseid, $ownpost=false, $reply=false, $link echo ''; } - echo '
'.format_string($post->subject).'
'; + if (!empty($post->subjectkeeplinks)) { + echo '
'.format_string($post->subject, false).'
'; + } else { + echo '
'.format_string($post->subject).'
'; + } echo '
'; $fullname = fullname($post, has_capability('moodle/site:viewfullnames', $modcontext)); diff --git a/mod/forum/search.php b/mod/forum/search.php index 7593d4c817d..5bd683a9313 100644 --- a/mod/forum/search.php +++ b/mod/forum/search.php @@ -201,6 +201,7 @@ } $post->subject = $fullsubject; + $post->subjectkeeplinks = true; // Identify search terms only found in HTML markup, and add a warning about them to // the start of the message text. However, do not do the highlighting here. forum_print_post