projects
/
liburi-template-perl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 0.17
[liburi-template-perl.git]
/
lib
/
URI
/
Template.pm
diff --git
a/lib/URI/Template.pm
b/lib/URI/Template.pm
index
79c944f
..
390f6a6
100644
(file)
--- a/
lib/URI/Template.pm
+++ b/
lib/URI/Template.pm
@@
-3,7
+3,7
@@
package URI::Template;
use strict;
use warnings;
use strict;
use warnings;
-our $VERSION = '0.1
6
';
+our $VERSION = '0.1
7
';
use URI;
use URI::Escape ();
use URI;
use URI::Escape ();
@@
-123,7
+123,10
@@
sub _tostring_query {
$join = '&' if $exp->{ op } =~ /[?&]/;
if ( ref $value eq 'ARRAY' ) {
$join = '&' if $exp->{ op } =~ /[?&]/;
if ( ref $value eq 'ARRAY' ) {
- return unless @$value;
+ if( !@$value ) {
+ return if $var->{ explode };
+ return $var->{ name } . '=';
+ }
if ( $var->{ explode } ) {
return join( $join,
map { $var->{ name } . '=' . _quote( $_, $safe ) } @$value );
if ( $var->{ explode } ) {
return join( $join,
map { $var->{ name } . '=' . _quote( $_, $safe ) } @$value );
@@
-134,7
+137,10
@@
sub _tostring_query {
}
}
elsif ( ref $value eq 'HASH' ) {
}
}
elsif ( ref $value eq 'HASH' ) {
- return unless keys %$value;
+ if( !keys %$value ) {
+ return if $var->{ explode };
+ return $var->{ name } . '=';
+ }
if ( $var->{ explode } ) {
return join(
$join,
if ( $var->{ explode } ) {
return join(
$join,
@@
-387,7
+393,7
@@
URI object.
=head1 COPYRIGHT AND LICENSE
=head1 COPYRIGHT AND LICENSE
-Copyright 2007-201
2
by Brian Cassidy
+Copyright 2007-201
3
by Brian Cassidy
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.