Skip to content

Commit 5516649

Browse files
author
Ilan Parmentier
authored
Avoid direct access to reviews list Ajax
Good evening, Do not know wether it is intentional, But you can access directly to the reviews list Ajax controller You can give it a try : /review/product/listAjax/id/111111616 => Display the raw output in the browser. Why not restrain this page to Ajax only. Give me your think, Ilan Parmentier
1 parent dfe7b89 commit 5516649

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/code/Magento/Review/Controller/Product/ListAjax.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ class ListAjax extends ProductController implements HttpGetActionInterface
2222
*/
2323
public function execute()
2424
{
25-
if (!$this->initProduct()) {
25+
if (!$this->getRequest()->isAjax()
26+
|| !$this->initProduct()) {
2627
/** @var \Magento\Framework\Controller\Result\Forward $resultForward */
2728
$resultForward = $this->resultFactory->create(ResultFactory::TYPE_FORWARD);
2829
return $resultForward->forward('noroute');

0 commit comments

Comments
 (0)