We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8a26739 + 1728b30 commit 80fc616Copy full SHA for 80fc616
lib/internal/Magento/Framework/View/Element/Html/Link/Current.php
@@ -23,6 +23,11 @@
23
*/
24
class Current extends Template
25
{
26
+ /**
27
+ * Search redundant /index and / in url
28
+ */
29
+ private const REGEX_INDEX_URL_PATTERN = '/(\/index|(\/))+($|\/$)/';
30
+
31
/**
32
* Default path
33
*
@@ -87,7 +92,9 @@ private function getMca()
87
92
88
93
public function isCurrent()
89
94
90
- return $this->getCurrent() || $this->getUrl($this->getPath()) == $this->getUrl($this->getMca());
95
+ return $this->getCurrent() ||
96
+ preg_replace(self::REGEX_INDEX_URL_PATTERN, '', $this->getUrl($this->getPath()))
97
+ == preg_replace(self::REGEX_INDEX_URL_PATTERN, '', $this->getUrl($this->getMca()));
91
98
}
99
100
0 commit comments