From 1954092b8d019bbaedede98167795f08878c8a08 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 6 Feb 2012 19:24:48 +0100 Subject: [PATCH] =?utf8?q?filename=20checks=20m=C3=BCssen=20auf=20defined?= =?utf8?q?=20sein,=20weil=20der=20dateiname=20auch=20leer=20sein=20kann.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Hintergrund: Wenn bei einem fileupload in einem [+] array die letzte Zeile leer ist, wird der Dateiname leer gelassen. Dadurch wurde die Dateizeile fälschlicherweise ins target einsortiert und hat dort die letzte Zeile der echten Uploads überschrieben. --- SL/Request.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SL/Request.pm b/SL/Request.pm index 38dfc1f23..a38f3c052 100644 --- a/SL/Request.pm +++ b/SL/Request.pm @@ -103,11 +103,11 @@ sub _parse_multipart_formdata { substr $line, $-[0], $+[0] - $-[0], ""; } - $previous = _store_value($filename ? $target : $temp_target, $name, '') if ($name); - $temp_target->{FILENAME} = $filename if ($filename); + $previous = _store_value(defined $filename ? $target : $temp_target, $name, '') if ($name); + $temp_target->{FILENAME} = $filename if (defined $filename); # for multiple uploads: save the attachments in a SL/Mailer like structure - if ($name && $filename) { + if ($name && defined $filename) { _store_value($target, "ATTACHMENTS.$name.data", $previous); _store_value($temp_target, "ATTACHMENTS.$name.filename", $filename); } -- 2.20.1