From 25db6e1545e4acd190841a58d7099f58d6f32142 Mon Sep 17 00:00:00 2001 From: skodak Date: Fri, 25 Jul 2008 22:43:08 +0000 Subject: [PATCH] MDL-15823 format_string() improvements --- lib/weblib.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 95ef27ca135..aec08bf1553 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1697,9 +1697,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