Skip to content
Browse files

MDL-15823 format_string() improvements; merged from MOODLE_19_STABLE

  • Loading branch information...
1 parent 8e3cb48 commit 7387acb1e0ee413e0967be40aa563bd148398eb7 skodak committed Jul 25, 2008
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/weblib.php
View
9 lib/weblib.php
@@ -1436,9 +1436,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[^>]+?>)(.+?)(<\/a>)/is','$2',$string);
+ } else {
+ // Otherwise strip just links if that is required (default)
+ if ($striplinks) { //strip links in string
+ $string = preg_replace('/(<a\s[^>]+?>)(.+?)(<\/a>)/is','$2',$string);
+ }
+ $string = clean_text($string);
}
//Store to cache

0 comments on commit 7387acb

Please sign in to comment.
Something went wrong with that request. Please try again.