summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcgi/shorten.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/cgi/shorten.pl b/cgi/shorten.pl
index b87bfc2..064d618 100755
--- a/cgi/shorten.pl
+++ b/cgi/shorten.pl
@@ -105,6 +105,7 @@ sub urldecode {
my $q=CGI->new();
my $path=$q->path_info()||'';
+$path=~s{^/}{};
my $url=$q->param('url');
if ($url) {
@@ -122,7 +123,7 @@ else {
else {
$path=decode('utf8',$path);
}
- my ($short,$rest) = ($path =~ m{^/(\w+)(.*)$});
+ my ($short,$rest) = ($path =~ m{^(\w+)(.*)$});
my $url=lengthen($short);
if ($url eq '404') {
say $q->header(-type=>'text/plain');