X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FRequest.pm;h=d4f2d88501b43a99208ea032ae6f8f653c83490c;hb=72be9c763f3b7f7df1fae4fe10011e45f9e2ad1d;hp=d339cb7be23e534a124552c1a069bda267b5dee7;hpb=6056e1d7ff9b26df2aa3a07ab0c615af1a9bbef4;p=kivitendo-erp.git diff --git a/SL/Request.pm b/SL/Request.pm index d339cb7be..d4f2d8850 100644 --- a/SL/Request.pm +++ b/SL/Request.pm @@ -153,8 +153,8 @@ sub _recode_recursively { # though. $to->{$key} = $iconv->convert("" . $from->{$key}); } else { - $to->{$key} = {} if 'HASH' eq ref $from->{$key}; - $to->{$key} = [] if 'ARRAY' eq ref $from->{$key}; + $to->{$key} ||= {} if 'HASH' eq ref $from->{$key}; + $to->{$key} ||= [] if 'ARRAY' eq ref $from->{$key}; _recode_recursively($iconv, $from->{$key}, $to->{$key}); } } @@ -167,8 +167,8 @@ sub _recode_recursively { # though. $from->[$idx] = $iconv->convert("" . $from->[$idx]); } else { - $to->[$idx] = {} if 'HASH' eq ref $from->[$idx]; - $to->[$idx] = [] if 'ARRAY' eq ref $from->[$idx]; + $to->[$idx] ||= {} if 'HASH' eq ref $from->[$idx]; + $to->[$idx] ||= [] if 'ARRAY' eq ref $from->[$idx]; _recode_recursively($iconv, $from->[$idx], $to->[$idx]); } } @@ -199,9 +199,6 @@ sub read_cgi_input { if ($ENV{CONTENT_LENGTH}) { my $content; read STDIN, $content, $ENV{CONTENT_LENGTH}; - open my $fh, '>:raw', '/tmp/blubb.bin' or die; - print $fh $content; - close $fh; if ($ENV{'CONTENT_TYPE'} && $ENV{'CONTENT_TYPE'} =~ /multipart\/form-data/) { # multipart formdata can bring it's own encoding, so give it both # and let ti decide on it's own @@ -212,18 +209,16 @@ sub read_cgi_input { } } + my $encoding = delete $temp_target->{INPUT_ENCODING} || $db_charset; + + _recode_recursively(SL::Iconv->new($encoding, $db_charset), $temp_target => $target) if keys %$target; + if ($target->{RESTORE_FORM_FROM_SESSION_ID}) { my %temp_form; $::auth->restore_form_from_session(delete $target->{RESTORE_FORM_FROM_SESSION_ID}, form => \%temp_form); _store_value($target, $_, $temp_form{$_}) for keys %temp_form; } - my $encoding = delete $temp_target->{INPUT_ENCODING} || $db_charset; - - _recode_recursively(SL::Iconv->new($encoding, $db_charset), $temp_target => $target) if keys %$target; - - map { $target->{$_} = $temp_target->{$_} } keys %{ $temp_target }; - $::lxdebug->leave_sub; return $target;