2006-08-31 Ernesto Baschny <ernst@cron-it.de>
authorErnesto Baschny <ernst@cron-it.de>
Thu, 31 Aug 2006 18:24:51 +0000 (18:24 +0000)
committerErnesto Baschny <ernst@cron-it.de>
Thu, 31 Aug 2006 18:24:51 +0000 (18:24 +0000)
* Fixed bug #4035/3971: Error message when uploading one or two files in file-browser (BE)

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1706 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_extfilefunc.php

index 819178b..0689e5e 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-08-31  Ernesto Baschny <ernst@cron-it.de>
+
+       * Fixed bug #4035/3971: Error message when uploading one or two files in file-browser (BE)
+
 2006-08-31  Ernesto Baschny <ernst@cron-it.de>
 
        * Feature #4131: Respects label_alt setting in some more places (especially labels pointing to MM tables)
index e7af10a..789e478 100755 (executable)
@@ -217,6 +217,19 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions      {
 
                if (is_array($this->fileCmdMap))        {
 
+                               // Check if there were uploads expected, but no one made
+                       if ($this->fileCmdMap['upload'])        {
+                               $uploads = $this->fileCmdMap['upload'];
+                               foreach ($uploads as $arr)      {
+                                       if (!$_FILES['upload_'.$arr['data']]['name'])   {
+                                               unset($this->fileCmdMap['upload'][$arr['data']]);
+                                       }
+                               }
+                               if (count($this->fileCmdMap['upload']) == 0) {
+                                       $this->writelog(1,1,108,'No file was uploaded!','');
+                               }
+                       }
+                               
                                // Traverse each set of actions
                        foreach($this->fileCmdMap as $action => $actionData)    {
 
@@ -811,7 +824,7 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions       {
                                        } else $this->writelog(1,1,104,'The uploaded file exceeds the size-limit of %s bytes',Array($this->maxUploadFileSize*1024));
                                } else $this->writelog(1,1,105,'You are not allowed to upload files!','');
                        } else $this->writelog(1,2,106,'The uploaded file did not exist!','');
-               } else $this->writelog(1,2,106,'No file was uploaded!','');
+               } else $this->writelog(1,2,108,'No file was uploaded!','');
        }
 
        /**