Fixed upload issue
authorMarcel Werk <burntime@woltlab.com>
Mon, 19 Aug 2013 19:28:27 +0000 (21:28 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 19 Aug 2013 19:28:27 +0000 (21:28 +0200)
wcfsetup/install/files/lib/system/upload/UploadHandler.class.php

index 6ff05540a3411856904a2e383622f3dda0b5f087..605a3e5c8dbc25b5ce2c5748f3fe2a926df5611c 100644 (file)
@@ -34,11 +34,11 @@ class UploadHandler {
                if (is_array($rawFileData['name'])) {
                        // multiple uploads
                        for ($i = 0, $l = count($rawFileData['name']); $i < $l; $i++) {
-                               $this->files[] = new UploadFile($rawFileData['name'][$i], $rawFileData['tmp_name'][$i], $rawFileData['size'][$i], $rawFileData['error'][$i], (FileUtil::getMimeType($rawFileData['tmp_name'][$i]) ?: $rawFileData['type'][$i]));
+                               $this->files[] = new UploadFile($rawFileData['name'][$i], $rawFileData['tmp_name'][$i], $rawFileData['size'][$i], $rawFileData['error'][$i], ($rawFileData['tmp_name'][$i] ? (FileUtil::getMimeType($rawFileData['tmp_name'][$i]) ?: $rawFileData['type'][$i]) : ''));
                        }
                }
                else {
-                       $this->files[] = new UploadFile($rawFileData['name'], $rawFileData['tmp_name'], $rawFileData['size'], $rawFileData['error'], (FileUtil::getMimeType($rawFileData['tmp_name']) ?: $rawFileData['type']));
+                       $this->files[] = new UploadFile($rawFileData['name'], $rawFileData['tmp_name'], $rawFileData['size'], $rawFileData['error'], ($rawFileData['tmp_name'] ? (FileUtil::getMimeType($rawFileData['tmp_name']) ?: $rawFileData['type']) : ''));
                }
        }