fixed Vulnerability issue while uploading images in hotel reviews
This commit is contained in:
@@ -85,6 +85,16 @@ class QloHotelReviewDefaultModuleFrontController extends ModuleFrontController
|
||||
}
|
||||
}
|
||||
|
||||
if (is_array($_FILES) && array_key_exists('images', $_FILES) ) {
|
||||
$allowedExtensions = array('jpg', 'png');
|
||||
foreach ($_FILES['images']['name'] as $key => $imageName) {
|
||||
$extension = Tools::strtolower(pathinfo($imageName, PATHINFO_EXTENSION));
|
||||
if (!in_array($extension, $allowedExtensions)) {
|
||||
$errors['general'][] = $imageName . ' ' . $objModule->l('is not a supported image format.','default');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!count($errors['by_key']) && !count($errors['general'])) {
|
||||
$customerReview = QhrHotelReview::getByCustomer(
|
||||
$objOrder->id_customer,
|
||||
|
||||
Reference in New Issue
Block a user