Revision e8557567
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/Request.pm | ||
---|---|---|
70 | 70 |
sub _input_to_hash { |
71 | 71 |
$::lxdebug->enter_sub(2); |
72 | 72 |
|
73 |
my ($target, $input) = @_; |
|
73 |
my ($target, $input, $log) = @_;
|
|
74 | 74 |
my @pairs = split(/&/, $input); |
75 | 75 |
|
76 | 76 |
foreach (@pairs) { |
77 | 77 |
my ($key, $value) = split(/=/, $_, 2); |
78 |
_store_value($target, uri_decode($key), uri_decode($value)) if ($key); |
|
78 |
next unless $key; |
|
79 |
_store_value($target, uri_decode($key), uri_decode($value)); |
|
80 |
|
|
81 |
# for debugging |
|
82 |
$::lxdebug->add_request_params(uri_decode($key) => uri_decode($value)) if $log; |
|
79 | 83 |
} |
80 | 84 |
|
81 | 85 |
$::lxdebug->leave_sub(2); |
82 | 86 |
} |
83 | 87 |
|
84 | 88 |
sub _parse_multipart_formdata { |
85 |
my ($target, $temp_target, $input) = @_; |
|
89 |
my ($target, $temp_target, $input, $log) = @_;
|
|
86 | 90 |
my ($name, $filename, $headers_done, $content_type, $boundary_found, $need_cr, $previous, $p_attachment, $encoding, $transfer_encoding); |
87 | 91 |
my $data_start = 0; |
88 | 92 |
|
... | ... | |
113 | 117 |
} else { |
114 | 118 |
${ $previous } = $data; |
115 | 119 |
} |
120 |
$::lxdebug->add_request_params($name, $$previous) if $log; |
|
116 | 121 |
|
117 | 122 |
undef $previous; |
118 | 123 |
undef $filename; |
... | ... | |
263 | 268 |
|
264 | 269 |
# since both of these can potentially bring their encoding in INPUT_ENCODING |
265 | 270 |
# they get dumped into temp_target |
266 |
_input_to_hash($temp_target, $ENV{QUERY_STRING}) if $ENV{QUERY_STRING}; |
|
267 |
_input_to_hash($temp_target, $ARGV[0]) if @ARGV && $ARGV[0];
|
|
271 |
_input_to_hash($temp_target, $ENV{QUERY_STRING}, 1) if $ENV{QUERY_STRING};
|
|
272 |
_input_to_hash($temp_target, $ARGV[0], 1) if @ARGV && $ARGV[0];
|
|
268 | 273 |
|
269 | 274 |
if ($ENV{CONTENT_LENGTH}) { |
270 | 275 |
my $content; |
... | ... | |
272 | 277 |
if ($ENV{'CONTENT_TYPE'} && $ENV{'CONTENT_TYPE'} =~ /multipart\/form-data/) { |
273 | 278 |
# multipart formdata can bring it's own encoding, so give it both |
274 | 279 |
# and let ti decide on it's own |
275 |
_parse_multipart_formdata($target, $temp_target, $content); |
|
280 |
_parse_multipart_formdata($target, $temp_target, $content, 1);
|
|
276 | 281 |
} else { |
277 | 282 |
# normal encoding must be recoded |
278 |
_input_to_hash($temp_target, $content); |
|
283 |
_input_to_hash($temp_target, $content, 1);
|
|
279 | 284 |
} |
280 | 285 |
} |
281 | 286 |
|
Auch abrufbar als: Unified diff
Neuer Debugparameter: Request
Loggt sinnvolle Informationen zum Request.