Skip to content

Commit 960c668

Browse files
committed
SwiftOtter-SOP-348 Resolve issues with Product listing with negative Page #
1 parent fab20b0 commit 960c668

File tree

1 file changed

+7
-0
lines changed
  • app/code/Magento/Catalog/Controller/Category

1 file changed

+7
-0
lines changed

app/code/Magento/Catalog/Controller/Category/View.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,13 @@ public function execute()
212212

213213
$category = $this->_initCategory();
214214
if ($category) {
215+
// Negative ?p= value is not supported, redirect to a base version of category page.
216+
if ($this->_request->getParam(Toolbar::PAGE_PARM_NAME) < 0) {
217+
return $this->resultRedirectFactory->create()
218+
->setHttpResponseCode(301)
219+
->setUrl($category->getUrl());
220+
}
221+
215222
$this->layerResolver->create(Resolver::CATALOG_LAYER_CATEGORY);
216223
$settings = $this->_catalogDesign->getDesignSettings($category);
217224

0 commit comments

Comments
 (0)