]> mj.ucw.cz Git - libucw.git/commitdiff
CGI.pm: Cope with corrupted cookie headers.
authorMartin Mares <mj@ucw.cz>
Sat, 13 Sep 2008 15:15:58 +0000 (17:15 +0200)
committerMartin Mares <mj@ucw.cz>
Sat, 13 Sep 2008 15:15:58 +0000 (17:15 +0200)
ucw/perl/CGI.pm

index 7389511a1d53f1868ab8f39b000bb71f879fad63..8e4096e69a6f61ef29b3501314464de390a84530 100644 (file)
@@ -459,7 +459,8 @@ sub parse_cookies() {
        my @cook = ();
        foreach my $x (split /;\s*/, $h) {
                my ($k,$v) = split /=/, $x;
-               push @cook, $k => url_deescape($v);
+               $v = url_deescape($v) if defined $v;
+               push @cook, $k => $v;
        }
        return @cook;
 }