X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FRequest.pm;h=860a0f0351ff8f4cfee0ffbc738dea581a424b24;hb=d8ac08282dad52789b8bea785e8cddae44085483;hp=5a840a641076202d6a13b3bdd3937b84999fe47b;hpb=8c6871bed016edac152019db5a7f88136bf9457b;p=kivitendo-erp.git diff --git a/SL/Request.pm b/SL/Request.pm index 5a840a641..860a0f035 100644 --- a/SL/Request.pm +++ b/SL/Request.pm @@ -70,19 +70,23 @@ sub _store_value { sub _input_to_hash { $::lxdebug->enter_sub(2); - my ($target, $input) = @_; + my ($target, $input, $log) = @_; my @pairs = split(/&/, $input); foreach (@pairs) { my ($key, $value) = split(/=/, $_, 2); - _store_value($target, uri_decode($key), uri_decode($value)) if ($key); + next unless $key; + _store_value($target, uri_decode($key), uri_decode($value)); + + # for debugging + $::lxdebug->add_request_params(uri_decode($key) => uri_decode($value)) if $log; } $::lxdebug->leave_sub(2); } sub _parse_multipart_formdata { - my ($target, $temp_target, $input) = @_; + my ($target, $temp_target, $input, $log) = @_; my ($name, $filename, $headers_done, $content_type, $boundary_found, $need_cr, $previous, $p_attachment, $encoding, $transfer_encoding); my $data_start = 0; @@ -113,6 +117,7 @@ sub _parse_multipart_formdata { } else { ${ $previous } = $data; } + $::lxdebug->add_request_params($name, $$previous) if $log; undef $previous; undef $filename; @@ -263,8 +268,8 @@ sub read_cgi_input { # since both of these can potentially bring their encoding in INPUT_ENCODING # they get dumped into temp_target - _input_to_hash($temp_target, $ENV{QUERY_STRING}) if $ENV{QUERY_STRING}; - _input_to_hash($temp_target, $ARGV[0]) if @ARGV && $ARGV[0]; + _input_to_hash($temp_target, $ENV{QUERY_STRING}, 1) if $ENV{QUERY_STRING}; + _input_to_hash($temp_target, $ARGV[0], 1) if @ARGV && $ARGV[0]; if ($ENV{CONTENT_LENGTH}) { my $content; @@ -272,10 +277,10 @@ sub read_cgi_input { 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 - _parse_multipart_formdata($target, $temp_target, $content); + _parse_multipart_formdata($target, $temp_target, $content, 1); } else { # normal encoding must be recoded - _input_to_hash($temp_target, $content); + _input_to_hash($temp_target, $content, 1); } } @@ -312,7 +317,7 @@ sub flatten { for (ref $source) { /^HASH$/ && do { my $first = 1; - for my $key (keys %$source) { + for my $key (sort keys %$source) { flatten($source->{$key} => $target, (defined $prefix ? $prefix . $arr_prefix->($first) . '.' : '') . $key); $first = 0; }; @@ -522,6 +527,13 @@ an 'AJAX' request. Returns the requested content type (either C, C or C). +=item C + +Set and retrieve the layout object for the current request. Must be an instance +of L. Defaults to an isntance of L. + +For more information about layouts, see L. + =back =head1 SPECIAL FUNCTIONS