mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Modified slighty the format_text() function!!
Now, in PLAIN AND WIKI formats, the rebuildnolinktag() function is called to rebuild: <nolink> to <nolink> again (open and close tags) This should avoid showing the "<nolink>" word always in this formats!! Used to solve Bug 1232 and potentially, others... (http://moodle.org/bugs/bug.php?op=show&bugid=1232) Please check it because it's really a CORE change!!
This commit is contained in:
parent
3eb2f7ecf8
commit
ab892a4fa2
@ -564,6 +564,7 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
|
||||
|
||||
case FORMAT_PLAIN:
|
||||
$text = htmlentities($text);
|
||||
$text = rebuildnolinktag($text);
|
||||
$text = str_replace(" ", " ", $text);
|
||||
replace_smilies($text);
|
||||
$text = nl2br($text);
|
||||
@ -571,6 +572,7 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
|
||||
|
||||
case FORMAT_WIKI:
|
||||
$text = wiki_to_html($text);
|
||||
$text = rebuildnolinktag($text);
|
||||
$text = filter_text($text, $courseid);
|
||||
break;
|
||||
|
||||
@ -2179,5 +2181,14 @@ function print_paging_bar($totalcount, $page, $perpage, $baseurl) {
|
||||
}
|
||||
}
|
||||
|
||||
//This function is used to rebuild the <nolink> tag because some formats (PLAIN and WIKI)
|
||||
//will transform it to html entities
|
||||
function rebuildnolinktag($text) {
|
||||
|
||||
$text = preg_replace('/<(\/*nolink)>/i','<$1>',$text);
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
// vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user