mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-15823 format_string() improvements; merged from MOODLE_19_STABLE
This commit is contained in:
parent
ad434752aa
commit
408d53277f
@ -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[^>]+?>)(.+?)(<\/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
|
||||
|
Loading…
x
Reference in New Issue
Block a user