Committer: anazarov
LJSUP-11559: Fix get parameters without valuesU trunk/cgi-bin/LJ/Request/Apache2.pm
Modified: trunk/cgi-bin/LJ/Request/Apache2.pm =================================================================== --- trunk/cgi-bin/LJ/Request/Apache2.pm 2012-03-19 11:28:27 UTC (rev 21448) +++ trunk/cgi-bin/LJ/Request/Apache2.pm 2012-03-19 11:39:09 UTC (rev 21449) @@ -407,12 +407,15 @@ my $r = $class->r(); if (wantarray()){ my $qs = $r->args(@_); - my @args = - map { URI::Escape::uri_unescape ($_) } - map { s/\+/ /g; $_ } # in query_string 'break' is encoded as '+' simbol - map { split /=/ => $_, 2 } - split /[\&\;]/ => $qs; - return @args; + my @args = split /[&;]/ => $qs; + return map { + my ($k, $v) = map { + s{\+} { }g; # in query_string 'break' is encoded as '+' simbol + URI::Escape::uri_unescape($_) + } split '=', $_, 2; + + defined $k? ($k, $v) : (); + } @args; } else { return $r->args(@_); }