Subject: | Empty arguments are incorrectly skipped in Template::Plugin::URL |
Date: | Thu, 16 Oct 2014 00:32:20 +0300 |
To: | bug-template-toolkit [...] rt.cpan.org |
From: | Ruslan Batdalov <linnando [...] yandex.ru> |
The code of Template::Plugin::URL skips arguments whose value is an empty string:
my $urlargs = join($JOINT,
map { args($_, $combo->{ $_ }) }
grep { defined $combo->{ $_ } && length $combo->{ $_ } }
sort keys %$combo);
But RFCs don't require an argument value to be non-empty. CGI module also differentiates between absent and empty params - the first one is undefined, while the second one is defined but zero-length. With current Template::Plugin::URL I can't use this distinction.
So, probably the code should be the following:
my $urlargs = join($JOINT,
map { args($_, $combo->{ $_ }) }
grep { defined $combo->{ $_ } }
sort keys %$combo);