PATCH: making links surrounded by <> live

View: New views
1 Messages — Rating Filter:   Alert me  

PATCH: making links surrounded by <> live

by Jim Tittsler-3 :: Rate this Message:

| View Threaded | Show Only this Message

When presented with a link like <http://example.com/>, CGIIRC  
rel_0_5_9 $ 0_5_CVS $Id: nph-irc.cgi,v 1.120 2006/06/06 18:50:12 dgl  
includes the trailing '>' in the URL and resulting link.

Replacing line 313 of nph-irc.cgi with:
    $line =~ s{((https?|ftp):\/\/[^\004$ ]+)(?![^<]*>)}{$interface-
 >link(format_remove($1), format_linkshorten($1))}gie;
appears to fix the problem in the typical case, but will fail if the  
URL includes & characters. The trailing '>' has been replaced with  
\004>\004 a couple of lines earlier.

I also suspect the negative lookahead assertion (?![^<]*>) is always  
true since I don't believe there will be any < or > characters by the  
time this regex happens.

Jim


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
cgiirc-general mailing list
cgiirc-general@...
https://lists.sourceforge.net/lists/listinfo/cgiirc-general