diff options
author | Yorhel <git@yorhel.nl> | 2017-12-26 14:28:18 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2017-12-26 14:28:20 +0100 |
commit | d0adbdc1808f91b213bc70c6d40f1a043a09544d (patch) | |
tree | 4223e7681742d509133c4a82b79ef6a21d0f4089 | |
parent | 3f40da291c90553aa9ddc05f28afab1404d1aa75 (diff) |
TUWF::Request: Fixup: Don't decode_utf8 an ENV var + check POST param names
Apparently %ENV doesn't like it when you decode_utf8() in-place, which
is, admittedly, not too surprising.
-rw-r--r-- | lib/TUWF/Request.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/TUWF/Request.pm b/lib/TUWF/Request.pm index 5b3852b..d75a2f5 100644 --- a/lib/TUWF/Request.pm +++ b/lib/TUWF/Request.pm @@ -135,7 +135,7 @@ sub _parse_multipart { } } - $name = decode_utf8 $name, 1; + $name = _check_control decode_utf8 $name, 1; # In the case of a file upload, use the filename as value instead of the # data. This is to ensure that reqPOST() always returns decoded data. @@ -267,7 +267,8 @@ sub reqHeader { my($self, $name) = @_; if(@_ == 2) { (my $v = uc $_[1]) =~ tr/-/_/; - return _check_control decode_utf8 $ENV{"HTTP_$v"}||'', 1; + $v = $ENV{"HTTP_$v"}||''; + return _check_control decode_utf8 $v, 1; } else { return (map { if(/^HTTP_/) { |