]> mj.ucw.cz Git - libucw.git/commitdiff
UCW::CGI: No deescaping should be applied to multipart/www-data
authorMartin Mares <mj@ucw.cz>
Wed, 18 Aug 2010 16:09:10 +0000 (18:09 +0200)
committerMartin Mares <mj@ucw.cz>
Wed, 18 Aug 2010 16:12:45 +0000 (18:12 +0200)
ucw/perl/UCW/CGI.pm

index d3325b9ffdd04be507e315f498abb65088bf474e..48d31ee293b6ab26d95a96002163b93d233e8a09 100644 (file)
@@ -149,6 +149,13 @@ sub parse_raw_args($) {
        }
 }
 
+sub parse_raw_args_ll($$) {
+       my ($arg, $s) = @_;
+       $s =~ s/\r\n/\n/g;
+       $s =~ s/\r/\n/g;
+       $raw_args{$arg} = $s;
+}
+
 sub parse_multipart_form_data();
 
 sub init_args() {
@@ -369,7 +376,7 @@ sub parse_multipart_form_data() {
                        if (defined $a->{"var"}) {
                                while (defined (my $l = get_mp_line(1))) {
                                        print STDERR "VALUE $l\n" if $debug;
-                                       parse_raw_args("$field=$l");
+                                       parse_raw_args_ll($field, $l);
                                }
                                next PART;
                        } elsif (defined $a->{"file"}) {