From: Lo?c C. <lo...@us...> - 2001-05-10 11:48:50
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib In directory usw-pr-cvs1:/tmp/cvs-serv26862/chat/lib Modified Files: format_messages.lib.php3 Log Message: Rewritten the work for url with no protocol Index: format_messages.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/format_messages.lib.php3,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** format_messages.lib.php3 2001/05/07 21:15:00 1.8 --- format_messages.lib.php3 2001/05/10 11:48:47 1.9 *************** *** 57,63 **** { // Handle urls and 'news:' links ! $urlPattern = '(^| )(([^ ]+://[^ ]+)|(www\\.[^ ]+)|(news:[^ ]+))( |$)'; ! $str = eregi_replace($urlPattern, '\\1<a href="\\2" target="_blank">\\2</a>\\6', $str); ! $str = str_replace('<a href="www', '<a href="http://www', str_replace('<a href="WWW', '<a href="http://WWW', $str)); // Handle e-mail address --- 57,63 ---- { // Handle urls and 'news:' links ! $urlPattern = '(^| )(([^ ]+://[^ ]+)|(news:[^ ]+))( |$)'; ! $str = eregi_replace('(^| )(www\\.[^ ]+)( |$)', '\\1http://\\2\\3', $str); ! $str = eregi_replace($urlPattern, '\\1<a href="\\2" target="_blank">\\2</a>\\5', $str); // Handle e-mail address |