2003-01-08 Ryan T. Sammartino <ryants@shaw.ca>
+ * common/include/utils.php(util_make_links): Change e-mail
+ regular expression so that e-mails must either start a line
+ or be preceeded by whitespace. This prevents URLs that
+ contain e-mail addresses from getting messed up (e.g.
+ http://mailman/user=foo@bar.com).
+
* www/forum/include/ForumHTML.class: first call util_make_links,
then do nl2br. This prevents <br /> from becoming part of a URL
that is at the end of a line.
$line = str_replace('>', "\1", $line);
$line = eregi_replace("([ \t]|^)www\."," http://www.",$line);
$text = eregi_replace("([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])", "<a href=\"\\1://\\2\\3\" target=\"_blank\" target=\"_new\">\\1://\\2\\3</a>", $line);
- $text = eregi_replace("(([a-z0-9_]|\\-|\\.)+@([^[:space:]]*)([[:alnum:]-]))", "<a href=\"mailto:\\1\" target=\"_new\">\\1</a>", $text);
+ $text = eregi_replace("([[:space:]]|^)(([a-z0-9_]|\\-|\\.)+@([^[:space:]]*)([[:alnum:]-]))", "\\1<a href=\"mailto:\\2\" target=\"_new\">\\2</a>", $text);
$text = str_replace("\1", '>', $text);
$newText .= $text;
}