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:
Rohit Jain
2023-01-19 16:27:18 +05:30
committed by GitHub
2 changed files with 12 additions and 4 deletions

View File

@@ -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'));
}

View File

@@ -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'));
}