From 075a59165658188a065434668a9de789afe2718b Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 26 Mar 2003 07:33:26 +0000 Subject: [PATCH] Better regular expresssion for detecting URLs at the very start of a text. I don't know what the old one thought it was doing! :-) --- lib/weblib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/weblib.php b/lib/weblib.php index 4b80b03de0..987670207d 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -524,7 +524,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("([\n\r ([])([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])", + $text = eregi_replace("([[:space:]]|^)([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])", "\\1\\2://\\3\\4", $text); /// eg www.moodle.com -- 2.39.5