-for my $this_cgi ( split('&',$limit_cgi) ) {
- next unless $this_cgi;
- # handle special case limit-yr
- if ($this_cgi =~ /yr,st-numeric/) {
- push @limit_inputs, { input_name => 'limit-yr', input_value => $limit_yr_value };
- next;
+if ($limit_cgi) {
+ for my $this_cgi ( split('&', $limit_cgi) ) {
+ next unless $this_cgi;
+ # handle special case limit-yr
+ if ($this_cgi =~ /yr,st-numeric/) {
+ push @limit_inputs, { input_name => 'limit-yr', input_value => $limit_yr_value };
+ next;
+ }
+ $this_cgi =~ m/(.*=)(.*)/;
+ my $input_name = $1;
+ my $input_value = $2;
+ $input_name =~ s/=$//;
+ push @limit_inputs, { input_name => $input_name, input_value => Encode::decode_utf8( uri_unescape($input_value) ) };