From d0adbdc1808f91b213bc70c6d40f1a043a09544d Mon Sep 17 00:00:00 2001 From: Yorhel Date: Tue, 26 Dec 2017 14:28:18 +0100 Subject: 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. --- lib/TUWF/Request.pm | 5 +++-- 1 file 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_/) { -- cgit v1.2.3