summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Skytt? <ville.skytta@iki.fi>2010-11-06 20:07:38 +0200
committerVille Skytt? <ville.skytta@iki.fi>2010-11-06 20:07:38 +0200
commit22a3794636752ea096fa7882c20ff150546ab1c5 (patch)
tree3b25a7604b7501151e763f2488b661a4458bac53
parent7fb4d81c324b8d6c5b59b499e9aaa078bfff8f02 (diff)
downloadmarkup-validator-22a3794636752ea096fa7882c20ff150546ab1c5.zip
markup-validator-22a3794636752ea096fa7882c20ff150546ab1c5.tar.gz
markup-validator-22a3794636752ea096fa7882c20ff150546ab1c5.tar.bz2
Actually decode CGI parameters as UTF-8.
IDN's and IRI's (in the uri parameter) now have a better chance of working.
-rwxr-xr-xhttpd/cgi-bin/check12
1 files changed, 9 insertions, 3 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index 8725ace..e7c57fd 100755
--- a/httpd/cgi-bin/check
+++ b/httpd/cgi-bin/check
@@ -2741,11 +2741,17 @@ sub prepCGI
$path_info = $q->path_info();
}
- # Avoid CGI.pm's "exists but undef" behaviour.
+ # Avoid CGI.pm's "exists but undef" behaviour, decode values.
if (scalar $q->param) {
foreach my $param ($q->param) {
- next if $param eq 'uploaded_file'; # 'uploaded_file' contains data.
- next if $param eq 'fragment'; # Ditto 'fragment'.
+
+ # '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 $value = $q->param($param);
+ $q->param($param, Encode::decode_utf8($value)) if defined($value);
+
next
if $param eq 'accept'
; # Original checking had a specific Accept: header sent.