Skip to content

Commit

Permalink
Merge pull request #6222 from dotani1111/dev/fix_invalid_page_error
Browse files Browse the repository at this point in the history
fix:validate page number
  • Loading branch information
ji-eunsoo authored Aug 7, 2024
2 parents f73f52c + 55bea2b commit d56d630
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Eccube/Controller/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function index(Request $request, PaginatorInterface $paginator)
/** @var SlidingPagination $pagination */
$pagination = $paginator->paginate(
$query,
!empty($searchData['pageno']) ? $searchData['pageno'] : 1,
!empty($searchData['pageno']) && preg_match('/^\d+$/', $searchData['pageno']) ? $searchData['pageno'] : 1,
!empty($searchData['disp_number']) ? $searchData['disp_number']->getId() : $this->productListMaxRepository->findOneBy([], ['sort_no' => 'ASC'])->getId()
);

Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Controller/SitemapController.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function product(Request $request, PaginatorInterface $paginator)
/** @var SlidingPagination $pagination */
$pagination = $paginator->paginate(
$productQueryBuilder,
$request->get('page'),
$request->get('page') ? : 1,
$this->eccubeConfig['eccube_sitemap_products_per_page']
);
$paginationData = $pagination->getPaginationData();
Expand Down

0 comments on commit d56d630

Please sign in to comment.