Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the URI-Encode CPAN distribution.

Report information
The Basics
Id: 80178
Status: resolved
Priority: 0/
Queue: URI-Encode

People
Owner: MITHUN [...] cpan.org
Requestors: Dan [...] DWright.Org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.07
Fixed in: (no value)



Subject: Default values don't work in URI::Encode, double_encode currently defaults to off.
In sub new(), you initialize your input hash with default values: 50 encode_reserved => 0, ... 54 double_encode => 1, However, after initializing, you immediately overwrite those defaults with whatever was passed in: 57 if ( ref $in[0] eq 'HASH' ) { $input = $in[0]; } 58 else { $input = {@in}; } The effect is that double_encode actually defaults to off, unless it is explicitly enabled when new() is called. I suggest you replace lines 46 through 58 with this instead: my %defaults = ( # this module, unlike URI::Escape, # does not encode reserved characters encode_reserved => 0, # Allow Double encoding? # defaults to YES double_encode => 1, ); my $input; if ( ref $in[0] eq 'HASH' ) { $input = $in[0]; } else { $input = {@in}; } foreach my $key ( keys %defaults ) { next if exists $input->{$key}; $input->{$key} = $defaults{$key}; } Regards, -Dan
Fixed and uploaded in 0.8. Thanks! -- Mithun