Find URLs at the beginning of lines ...

This commit is contained in:
moodler 2002-10-18 17:05:17 +00:00
parent 958aafe2b4
commit 0be05df068

View File

@ -410,7 +410,7 @@ function text_to_html($text, $smiley=true, $para=true) {
$text = eregi_replace(">([\n\r])", "> ", $text);
// Make lone URLs into links. eg http://moodle.com/
$text = eregi_replace("([ ([])([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])",
$text = eregi_replace("([\n\r ([])([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])",
"\\1<A HREF=\"\\2://\\3\\4\" TARGET=\"newpage\">\\2://\\3\\4</A>", $text);
// eg www.moodle.com