From 408d53277f8e9d6113a65ba806df38d492d714b4 Mon Sep 17 00:00:00 2001 From: skodak Date: Fri, 25 Jul 2008 22:44:17 +0000 Subject: [PATCH] MDL-15823 format_string() improvements; merged from MOODLE_19_STABLE --- lib/weblib.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 9daa71ca2d..ed31605fa4 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1609,9 +1609,12 @@ function format_string ($string, $striplinks=true, $courseid=NULL ) { if (!empty($CFG->formatstringstriptags)) { $string = strip_tags($string); - // Otherwise strip just links if that is required (default) - } else if ($striplinks) { //strip links in string - $string = preg_replace('/(]+?>)(.+?)(<\/a>)/is','$2',$string); + } else { + // Otherwise strip just links if that is required (default) + if ($striplinks) { //strip links in string + $string = preg_replace('/(]+?>)(.+?)(<\/a>)/is','$2',$string); + } + $string = clean_text($string); } //Store to cache -- 2.39.5