From d4edb159ae1318fd934dadbdec2af2a7d6e6e00a Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Wed, 25 Jul 2012 13:42:22 +0200 Subject: [PATCH] Use binmode to set stdout to raw when printing uploaded files. The bug involved uploaded images not being decoded correctly. --- wiki.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/wiki.pl b/wiki.pl index 6ce55b97..7bfb876a 100755 --- a/wiki.pl +++ b/wiki.pl @@ -3132,6 +3132,7 @@ sub DoDownload { if @UploadTypes and not $allowed{$type}; print GetHttpHeader($type, $ts, undef, $encoding); require MIME::Base64; + binmode(STDOUT, "raw"); print MIME::Base64::decode($data); } else { print GetHttpHeader('text/plain', $ts);