Request: Dateiupload in form arrays[] gefixt
authorMartin Helmling <martin.helmling@octosoft.eu>
Fri, 9 Oct 2015 09:05:12 +0000 (11:05 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Fri, 9 Oct 2015 09:05:12 +0000 (11:05 +0200)
_recode_recursively hatte die Weiche für Dateiupload nur bei
Hashzugriff, und hat im Array-Kontext die Daten überschrieben.

SL/Request.pm

index 3700921..f72694d 100644 (file)
@@ -251,7 +251,7 @@ sub _recode_recursively {
         # Workaround for a bug: converting $from->[$idx] directly
         # leads to 'undef'. I don't know why. Converting a copy works,
         # though.
-        $to->[$idx] = $iconv->convert("" . $from->[$idx]);
+        $to->[$idx] = $iconv->convert("" . $from->[$idx]) if defined $from->[$idx] && !defined $to->[$idx];
       } else {
         $to->[$idx] ||= {} if 'HASH'  eq ref $from->[$idx];
         $to->[$idx] ||= [] if 'ARRAY' eq ref $from->[$idx];