[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to avoid auto-linking in non-ascii URLs



In <200603242013.k2OKDq0V003723@xxxxxxxxxxxxxxxxxx>,
 earl@xxxxxxxxxxxx wrote:
> > If so, I think that MHonARC, even in default settings, should treat
> > these characters as invalid URL characters in URL linking code.
> > 
> > > The URL linking code is a single regex operation.
> 
> Entity reference resolution would need to be done, and I am not
> sure it is worth the effort for url linking.
> 
> Patches are welcome.

Okay, I see.

The following is another simple workaround for URL linking in default
setting.

Thanks,
Masao


diff -rub MHonArc-2.6.15.orig/lib/mhtxtplain.pl MHonArc-2.6.15/lib/mhtxtplain.pl
--- MHonArc-2.6.15.orig/lib/mhtxtplain.pl	2005-06-20 13:25:18.000000000 +0900
+++ MHonArc-2.6.15/lib/mhtxtplain.pl	2006-03-25 09:48:19.861240096 +0900
@@ -43,7 +43,7 @@
 			 q/[^\s\(\)\|<>"'\0-\037]+/ .
 			 q/[^\.?!;,"'\|\[\]\(\)\s<>\0-\037]/;
 $HUrlExp        = $readmail::UrlRxStr .
-			 q/(?:&(?![gl]t;)|[^\s\(\)\|<>"'\&\0-\037])+/ .
+			 q/(?:&(?!(?:[gl]t|\#x[0-9A-F]+);)|[^\s\(\)\|<>"'\&\0-\037])+/ .
 			 q/[^\.?!;,"'\|\[\]\(\)\s<>\&\0-\037]/;
 $QuoteChars	= '[>]';
 $HQuoteChars	= '&gt;';


[Site Home]     [Bugtraq]     [Books]     [Photo]     [Yosemite]     [Linux Security]     [Linux Resources]     [Yosemite Campsites]     [Yosemite News]     [Mhonarc Home]

Powered by Linux