func_upload() now logs if no file was uploaded.
authorKarsten Dambekalns <karsten.dambekalns@typo3.org>
Wed, 28 Jun 2006 11:00:20 +0000 (11:00 +0000)
committerKarsten Dambekalns <karsten.dambekalns@typo3.org>
Wed, 28 Jun 2006 11:00:20 +0000 (11:00 +0000)
The last error message encountered is store in member variable $lastError.

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

t3lib/class.t3lib_extfilefunc.php

index 28dbe52..dc3fce5 100755 (executable)
@@ -139,7 +139,7 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions       {
                // Internal, dynamic:
        var $internalUploadMap = array();       // Will contain map between upload ID and the final filename
 
-
+       var $lastError = '';
 
 
        /**
@@ -359,6 +359,7 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions       {
                if (is_object($GLOBALS['BE_USER']))     {
                        $GLOBALS['BE_USER']->writelog($type,$action,$error,$details_nr,$details,$data);
                }
+               $this->lastError = vsprintf($details, $data);
        }
 
 
@@ -808,7 +809,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!','');
        }
 
        /**