diff options
author | Ville Skytt? <ville.skytta@iki.fi> | 2010-11-09 18:42:42 +0200 |
---|---|---|
committer | Ville Skytt? <ville.skytta@iki.fi> | 2010-11-09 18:42:42 +0200 |
commit | a694e861aa28a3da8afe08ee1a874c8d329caec1 (patch) | |
tree | 5402e45e680dd5dc6344a24a8d0a6b5fb86f0a78 | |
parent | 1b3db4048fc297e59a335a22ff334428ff4763a2 (diff) | |
download | markup-validator-a694e861aa28a3da8afe08ee1a874c8d329caec1.zip markup-validator-a694e861aa28a3da8afe08ee1a874c8d329caec1.tar.gz markup-validator-a694e861aa28a3da8afe08ee1a874c8d329caec1.tar.bz2 |
Remove outdated comments and unnecessary code.
-rwxr-xr-x | httpd/cgi-bin/check | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index cdfb939..f92cdc8 100755 --- a/httpd/cgi-bin/check +++ b/httpd/cgi-bin/check @@ -2741,33 +2741,31 @@ sub prepCGI $path_info = $q->path_info(); } - # Avoid CGI.pm's "exists but undef" behaviour, decode values. - if (scalar $q->param) { - foreach my $param ($q->param) { - - # 'uploaded_file' and 'fragment' contain data we treat as is. - next if ($param eq 'uploaded_file' || $param eq 'fragment'); - - # Decode all other defined values as UTF-8. - my @values = map { Encode::decode_utf8($_) } $q->param($param); - $q->param($param, @values); - - next - if $param eq 'accept' - ; # Original checking had a specific Accept: header sent. - next if $param eq 'accept-language'; # Ditto Accept-Language:. - next if $param eq 'accept-charset'; # Ditto Accept-Charset:. - next if $q->param($param) eq '0'; # Keep false-but-set params. - - # - # Parameters that are given to us without specifying a value get - # set to "1" (the "TRUE" constant). This is so we can test for the - # boolean value of a parameter instead of first checking whether - # the param was given and then testing its value. Needed because - # CGI.pm sets ";param" and ";param=" to a boolean false value - # (undef() or a null string, respectively). - $q->param($param, TRUE) unless $q->param($param); - } + # Decode parameter values, set booleans the way we expect them. + foreach my $param ($q->param()) { + + # 'uploaded_file' and 'fragment' contain data we treat as is. + next if ($param eq 'uploaded_file' || $param eq 'fragment'); + + # Decode all other defined values as UTF-8. + my @values = map { Encode::decode_utf8($_) } $q->param($param); + $q->param($param, @values); + + # Original checking had a specific Accept: header sent. + next if $param eq 'accept'; + + # Ditto Accept-Language:. + next if $param eq 'accept-language'; + + # Ditto Accept-Charset:. + next if $param eq 'accept-charset'; + + # Keep false-but-set params. + next if $q->param($param) eq '0'; + + # Parameters that are given to us without specifying a value get set + # to a true value. + $q->param($param, TRUE) unless $q->param($param); } # IIS reportedly does not provide the $path_info we expect - hack around it. |