[rt-users] ClickableLinks

Brandon Pulsipher brandonp at omniture.com
Fri May 13 14:18:32 EDT 2005


I've implemented the ClickableLinks patch:

http://wiki.bestpractical.com/index.cgi?ClickableLinks

from the Wiki.  This works except that it doesn't include the query
string in  the link.  

 

So, if I put in the URL:  http://www.somehost.com?mypage
<http://www.somehost.com/?mypage> =1&var=2

All that the link uses is:  http://www.somehost.com
<http://www.somehost.com/> 

 

I assume this could be corrected with some regular expression magic, but
the implemented regexp is beyond the scope of anyone here.  Can anyone
help modify this?

 

Thank you!

 

Here is the regexp used:

 

 

        $content =~
s@(https?://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.
)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){
3}))(?::(?:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{
2}))|[;:\@&=#])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))
|[;:\@&=#])*))*)(?:\?(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))
|[;:\@&=#])*))?)?)|(?:ftp://(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a
-fA-F\d]{2}))|[;?&=])*)(?::(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d
]{2}))|[;?&=])*))?\@)?(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA
-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\
.(?:\d+)){3}))(?::(?:\d+))?))(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%
[a-fA-F\d]{2}))|[?:\@&=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA
-F\d]{2}))|[?:\@&=])*))*)(?:;type=[AIDaid])?)?)|(?:mailto:(?:(?:[a-zA-Z\
d$\-_.+!*'(),;/?:\@&=]|(?:%[a-fA-F\d]{2}))+))@<a href=\"$1\"
target=\"_blank\">$1</a>@g;

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20050513/e96ef843/attachment.htm>


More information about the rt-users mailing list