Add file type validation
This commit is contained in:
@@ -1703,6 +1703,10 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$this->errors[] = $this->l('Please upload a document.');
|
||||
} elseif ($objHotelBookingDocument->fileInfo['size'] > Tools::getMaxUploadSize()) {
|
||||
$this->errors[] = $this->l('Uploaded file size is too large.');
|
||||
} elseif(!ImageManager::isRealImage($objHotelBookingDocument->fileInfo['tmp_name'])
|
||||
|| $objHotelBookingDocument->fileInfo['mime'] != 'application/pdf'
|
||||
) {
|
||||
$this->errors[] = $this->l('Please upload an image or a PDF file only.');
|
||||
}
|
||||
|
||||
if (!count($this->errors)) {
|
||||
|
||||
Reference in New Issue
Block a user