Skip to content
Snippets Groups Projects
Commit 162a277b authored by deuce's avatar deuce
Browse files

Decode the URI before using it as the target.

parent be9d000d
No related branches found
No related tags found
No related merge requests found
......@@ -183,6 +183,8 @@ function idx_to_user(fromidx)
}
function make_links(str) {
str=str.replace(/(?:http|https|ftp|telnet|gopher|irc|news)\:\/\/[\w\-\.]+\.[a-zA-Z]+(?::[\w]*)?(?:\/(?:[\w\-._\?\,\/\\\+&%\$#\=~\*]*))?[^,.\(\)&\s]/gi,'<a href="$&" target="_blank">$&</a>');
return(str)
str=str.replace(/(?:http|https|ftp|telnet|gopher|irc|news)\:\/\/[\w\-\.]+\.[a-zA-Z]+(?::[\w]*)?(?:\/(?:[\w\-._\?\,\/\\\+&%\$#\=~\*]*))?[^,.\(\)&\s]/gi,function(str) {
var ret='<a href="'+html_decode(str)+'" target="_blank">'+str+'</a>';
return(ret);}
);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment