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!!
case FORMAT_PLAIN:
$text = htmlentities($text);
+ $text = rebuildnolinktag($text);
$text = str_replace(" ", " ", $text);
replace_smilies($text);
$text = nl2br($text);
case FORMAT_WIKI:
$text = wiki_to_html($text);
+ $text = rebuildnolinktag($text);
$text = filter_text($text, $courseid);
break;
}
}
+//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:
?>