Merge pull request #504 from abhishek-webkul/fix-ajax-404
Fix ajax page not found issue on room type detail page
This commit is contained in:
@@ -99,11 +99,15 @@ class CategoryControllerCore extends FrontController
|
||||
$dateFrom = Tools::getValue('date_from');
|
||||
$dateTo = Tools::getValue('date_to');
|
||||
|
||||
if ($dateFrom != '' && !Validate::isDate($dateFrom)) {
|
||||
$currentTimestamp = strtotime(date('Y-m-d'));
|
||||
$dateFromTimestamp = strtotime($dateFrom);
|
||||
$dateToTimestamp = strtotime($dateTo);
|
||||
|
||||
if ($dateFrom != '' && ($dateFromTimestamp === false || ($dateFromTimestamp < $currentTimestamp))) {
|
||||
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
|
||||
}
|
||||
|
||||
if ($dateTo != '' && !Validate::isDate($dateTo)) {
|
||||
if ($dateTo != '' && ($dateToTimestamp === false || ($dateToTimestamp < $currentTimestamp))) {
|
||||
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
|
||||
}
|
||||
|
||||
|
||||
@@ -92,11 +92,15 @@ class ProductControllerCore extends FrontController
|
||||
$dateFrom = Tools::getValue('date_from');
|
||||
$dateTo = Tools::getValue('date_to');
|
||||
|
||||
if ($dateFrom != '' && !Validate::isDate($dateFrom)) {
|
||||
$currentTimestamp = strtotime(date('Y-m-d'));
|
||||
$dateFromTimestamp = strtotime($dateFrom);
|
||||
$dateToTimestamp = strtotime($dateTo);
|
||||
|
||||
if ($dateFrom != '' && ($dateFromTimestamp === false || ($dateFromTimestamp < $currentTimestamp))) {
|
||||
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
|
||||
}
|
||||
|
||||
if ($dateTo != '' && !Validate::isDate($dateTo)) {
|
||||
if ($dateTo != '' && ($dateToTimestamp === false || ($dateToTimestamp < $currentTimestamp))) {
|
||||
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user