diff --git a/administrator/components/com_media/controllers/file.php b/administrator/components/com_media/controllers/file.php index 7d5ee2952afd1..56957d47f0ca8 100644 --- a/administrator/components/com_media/controllers/file.php +++ b/administrator/components/com_media/controllers/file.php @@ -60,6 +60,14 @@ public function upload() $this->setRedirect('index.php?option=com_media&folder=' . $this->folder); } + if (!$files) + { + // If we could not get any data from the request we can not upload it. + JFactory::getApplication()->enqueueMessage(JText::_('COM_MEDIA_ERROR_WARNFILENOTSAFE'), 'error'); + + return false; + } + // Authorize the user if (!$this->authoriseUser('create')) { @@ -143,7 +151,6 @@ public function upload() if (!MediaHelper::canUpload($file, $err)) { // The file can't be uploaded - return false; } diff --git a/administrator/language/en-GB/en-GB.com_media.ini b/administrator/language/en-GB/en-GB.com_media.ini index 86da77181b313..a5643a13b8f4c 100644 --- a/administrator/language/en-GB/en-GB.com_media.ini +++ b/administrator/language/en-GB/en-GB.com_media.ini @@ -40,6 +40,7 @@ COM_MEDIA_ERROR_UNABLE_TO_DELETE=" Unable to delete: " COM_MEDIA_ERROR_UNABLE_TO_UPLOAD_FILE="Unable to upload file." COM_MEDIA_ERROR_UPLOAD_INPUT="Please input a file to upload" COM_MEDIA_ERROR_WARNFILENAME="File name must only contain alphanumeric characters and no spaces." +COM_MEDIA_ERROR_WARNFILENOTSAFE="You have tried to upload file(s) that are not safe." COM_MEDIA_ERROR_WARNFILETOOLARGE="This file is too large to upload." COM_MEDIA_ERROR_WARNFILETYPE="This file type is not supported." COM_MEDIA_ERROR_WARNIEXSS="Possible IE XSS Attack found."