From 1b722bb1eac9c3a568de6f203ecd2277d1c1fd6b Mon Sep 17 00:00:00 2001 From: Artem Savkov Date: Thu, 14 Jul 2011 11:48:39 +0400 Subject: shortening support for protocols other than http(s) --- tinyurl-tabcomplete/complete-tiny-url.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinyurl-tabcomplete/complete-tiny-url.pl b/tinyurl-tabcomplete/complete-tiny-url.pl index 45a00c0..ad43c5e 100644 --- a/tinyurl-tabcomplete/complete-tiny-url.pl +++ b/tinyurl-tabcomplete/complete-tiny-url.pl @@ -123,7 +123,7 @@ sub match_uri { if ($text =~ $regex) { my $uri = $1; # shorten needs the http prefix or it'll treat it as a relative link. - $uri = 'http://' . $uri if $uri !~ m(https?://); + $uri = 'http://' . $uri if $uri !~ m([a-z][\w-]+:(?:/{1,3}|[a-z0-9%])); return $uri; } else { # no match -- cgit v1.2.3