Skip to content

Commit 3483cc4

Browse files
committed
MCLOUD-13752: Improve category view
1 parent fcc8141 commit 3483cc4

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

patches.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@
301301
},
302302
"Patch - Improve-web-api-async-performance": {
303303
">=2.4.4 <2.4.4-p13 || >=2.4.5 <2.4.5-p12 || >=2.4.6 <2.4.6-p10 || >=2.4.7 <2.4.7-p5 || 2.4.8": "MCLOUD-13619__Improve_web_api_async_performance__2.4.x.patch"
304+
},
305+
"Patch for CVE-2025-47109 - Improve-category-view": {
306+
"2.4.8": "MCLOUD-13752__Patch_for_CVE-2025-47109_Improve_category_view__2.4.8.patch"
304307
}
305308
},
306309
"magento/module-paypal": {
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
diff --git a/vendor/magento/module-catalog/Helper/Category.php b/vendor/magento/module-catalog/Helper/Category.php
2+
index fe511d40e9caa..761dc6f62adda 100644
3+
--- a/vendor/magento/module-catalog/Helper/Category.php
4+
+++ b/vendor/magento/module-catalog/Helper/Category.php
5+
@@ -10,8 +10,10 @@
6+
use Magento\Catalog\Model\CategoryFactory;
7+
use Magento\Framework\App\Helper\AbstractHelper;
8+
use Magento\Framework\App\Helper\Context;
9+
+use Magento\Framework\App\ObjectManager;
10+
use Magento\Framework\Data\CollectionFactory;
11+
use Magento\Framework\Data\Tree\Node\Collection;
12+
+use Magento\Framework\Escaper;
13+
use Magento\Framework\Exception\NoSuchEntityException;
14+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
15+
use Magento\Store\Model\ScopeInterface;
16+
@@ -63,24 +65,33 @@ class Category extends AbstractHelper implements ResetAfterRequestInterface
17+
*/
18+
protected $categoryRepository;
19+
20+
+ /**
21+
+ * @var Escaper|null
22+
+ */
23+
+ private ?Escaper $escaper;
24+
+
25+
/**
26+
* @param Context $context
27+
* @param CategoryFactory $categoryFactory
28+
* @param StoreManagerInterface $storeManager
29+
* @param CollectionFactory $dataCollectionFactory
30+
* @param CategoryRepositoryInterface $categoryRepository
31+
+ * @param Escaper|null $escaper
32+
*/
33+
public function __construct(
34+
Context $context,
35+
CategoryFactory $categoryFactory,
36+
StoreManagerInterface $storeManager,
37+
CollectionFactory $dataCollectionFactory,
38+
- CategoryRepositoryInterface $categoryRepository
39+
+ CategoryRepositoryInterface $categoryRepository,
40+
+ ?Escaper $escaper = null
41+
) {
42+
$this->_categoryFactory = $categoryFactory;
43+
$this->_storeManager = $storeManager;
44+
$this->_dataCollectionFactory = $dataCollectionFactory;
45+
$this->categoryRepository = $categoryRepository;
46+
+ $this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class);
47+
+
48+
parent::__construct($context);
49+
}
50+
51+
@@ -204,6 +215,7 @@ public function getCanonicalUrl(string $categoryUrl): string
52+
if ($params && isset($params['p'])) {
53+
$categoryUrl = $categoryUrl . '?p=' . $params['p'];
54+
}
55+
- return $categoryUrl;
56+
+
57+
+ return $this->escaper->escapeUrl($categoryUrl);
58+
}
59+
}

0 commit comments

Comments
 (0)