Skip to content

Commit 80fc616

Browse files
authored
ENGCOM-5608: Resolve Account sidebar current tab is not marked as Active (issue 24068) #24078
2 parents 8a26739 + 1728b30 commit 80fc616

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/internal/Magento/Framework/View/Element/Html/Link/Current.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
*/
2424
class Current extends Template
2525
{
26+
/**
27+
* Search redundant /index and / in url
28+
*/
29+
private const REGEX_INDEX_URL_PATTERN = '/(\/index|(\/))+($|\/$)/';
30+
2631
/**
2732
* Default path
2833
*
@@ -87,7 +92,9 @@ private function getMca()
8792
*/
8893
public function isCurrent()
8994
{
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()));
9198
}
9299

93100
/**

0 commit comments

Comments
 (0)