]> mj.ucw.cz Git - libucw.git/blobdiff - lib/perl/CGI.pm
CGI: Added "multiline" flag, which allows newline in parameter values.
[libucw.git] / lib / perl / CGI.pm
index 79db231b06092d4b3e5f11e06316b125db598d67..55e76e1c7fb4b56a79ad20148a80b10b47cb4f11 100644 (file)
@@ -91,8 +91,10 @@ sub parse_arg_string($) {
                my $arg = $arg_table->{$1} or next;
                $_ = $2;
                s/\+/ /g;
-               s/%(..)/pack("c",hex $1)/eg;
-               s/(\r|\n|\t)/ /g;
+               s/%(..)/pack("H2",$1)/eg;
+               s/\r\n/\n/g;
+               s/\r/\n/g;
+               $arg->{'multiline'} || s/(\n|\t)/ /g;
                s/^\s+//;
                s/\s+$//;
                if (my $rx = $arg->{'check'}) {