]> Sergey Matveev's repositories - public-inbox.git/commitdiff
www: avoid undefined warnings for query string parsing
authorEric Wong <e@80x24.org>
Tue, 9 May 2017 20:43:33 +0000 (20:43 +0000)
committerEric Wong <e@80x24.org>
Tue, 9 May 2017 20:43:33 +0000 (20:43 +0000)
Sometimes bots generate malformed queries with sequential
"&" and ";" characters.

lib/PublicInbox/WWW.pm

index 62e4ca43511fc4962cbba6b59b0cdab18444fd99..13b3921dc808783ba85d77a3af0bcf57b872858f 100644 (file)
@@ -46,7 +46,7 @@ sub call {
                $v = '' unless defined $v;
                $v =~ tr/+/ /;
                ($k, $v)
-       } split(/[&;]/, $env->{QUERY_STRING});
+       } split(/[&;]+/, $env->{QUERY_STRING});
        $ctx->{qp} = \%qp;
 
        my $path_info = $env->{PATH_INFO};