]> git.mjollnir.org Git - moodle.git/commitdiff
Solve this silly mpersand display problem
authormoodler <moodler>
Thu, 23 Jan 2003 05:03:27 +0000 (05:03 +0000)
committermoodler <moodler>
Thu, 23 Jan 2003 05:03:27 +0000 (05:03 +0000)
lib/weblib.php

index 3a476cc51c2c2f86bf9e1fac5bdb9e05fe111c03..c6130b138d13817e2cc696e1dd890fe4789eb4ae 100644 (file)
@@ -521,6 +521,9 @@ function text_to_html($text, $smiley=true, $para=true) {
     $text = eregi_replace("([\n\r])<", " <", $text);
     $text = eregi_replace(">([\n\r])", "> ", $text);
 
+/// Replace ampersands
+    $text = eregi_replace("&", "&amp;", $text);
+
 /// Make lone URLs into links.   eg http://moodle.com/
     $text = eregi_replace("([\n\r ([])([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])", 
                           "\\1<A HREF=\"\\2://\\3\\4\" TARGET=\"newpage\">\\2://\\3\\4</A>", $text);