[cgiirc-general] PATCH: making links surrounded by <> live
Brought to you by:
dgl
From: Jim T. <jt...@on...> - 2007-07-13 23:10:28
|
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 |