From: Lo?c C. <lo...@us...> - 2001-03-27 19:34:03
|
Update of /cvsroot/phpmychat/phpMyChat - 0.14/chat In directory usw-pr-cvs1:/tmp/cvs-serv5250 Modified Files: input.php3 handle_inputH.php3 Log Message: Fix for the detction of certains 'malformed' URLs in messages ***** Bogus filespec: - ***** Bogus filespec: 0.14/chat Index: input.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat - 0.14/chat/input.php3,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** input.php3 2001/03/24 16:09:24 1.7 --- input.php3 2001/03/27 19:33:59 1.8 *************** *** 131,135 **** // URL $M = eregi_replace('([[:space:]]|^)(www)', '\\1http://\\2', $M); // no prefix (www.myurl.ext) ! $M = eregi_replace('([[:alpha:]]+)://([^[:space:]]*)([[:alnum:]#\?/&=])', '<a href="\\1://\\2\\3" target="_blank">\\1://\\2\\3</a>', $M); // e-mail addresses --- 131,137 ---- // URL $M = eregi_replace('([[:space:]]|^)(www)', '\\1http://\\2', $M); // no prefix (www.myurl.ext) ! $prefix = '(http|https|ftp|telnet|news|gopher|file|wais)://'; ! $pureUrl = '([[:alnum:]/\n+-=%&:_.~?]+[#[:alnum:]+]*)'; ! $M = eregi_replace($prefix . $pureUrl, '<a href="\\1://\\2" target="_blank">\\1://\\2</a>', $M); // e-mail addresses Index: handle_inputH.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat - 0.14/chat/handle_inputH.php3,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** handle_inputH.php3 2001/03/24 16:09:24 1.4 --- handle_inputH.php3 2001/03/27 19:33:59 1.5 *************** *** 135,139 **** // URL $M = eregi_replace('([[:space:]]|^)(www)', '\\1http://\\2', $M); // no prefix (www.myurl.ext) ! $M = eregi_replace('([[:alpha:]]+)://([^[:space:]]*)([[:alnum:]#\?/&=])', '<a href="\\1://\\2\\3" target="_blank">\\1://\\2\\3</a>', $M); // e-mail addresses --- 135,141 ---- // URL $M = eregi_replace('([[:space:]]|^)(www)', '\\1http://\\2', $M); // no prefix (www.myurl.ext) ! $prefix = '(http|https|ftp|telnet|news|gopher|file|wais)://'; ! $pureUrl = '([[:alnum:]/\n+-=%&:_.~?]+[#[:alnum:]+]*)'; ! $M = eregi_replace($prefix . $pureUrl, '<a href="\\1://\\2" target="_blank">\\1://\\2</a>', $M); // e-mail addresses |