Merge pull request #373 from abhishek-webkul/gli-760

Redirect to 404 page in case of bad search
This commit is contained in:
Rohit Jain
2022-09-23 14:38:56 +05:30
committed by GitHub

View File

@@ -104,7 +104,7 @@ class CategoryControllerCore extends FrontController
if (!$this->category->active || !Validate::isLoadedObject($this->category) || !$this->category->inShop() || !$this->category->isAssociatedToShop() || in_array($this->category->id, array(Configuration::get('PS_HOME_CATEGORY'), Configuration::get('PS_ROOT_CATEGORY')))) {
header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');
$this->errors[] = Tools::displayError('Category not found');
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
} else
// Check if category can be accessible by current customer and return 403 if not
if (!$this->category->checkAccess($this->context->customer->id)) {