File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
lib/internal/Magento/Framework/View/Element/Html/Link Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 23
23
*/
24
24
class Current extends Template
25
25
{
26
+ /**
27
+ * Search redundant /index and / in url
28
+ */
29
+ private const REGEX_INDEX_URL_PATTERN = '/(\/index|(\/))+($|\/$)/ ' ;
30
+
26
31
/**
27
32
* Default path
28
33
*
@@ -88,8 +93,8 @@ private function getMca()
88
93
public function isCurrent ()
89
94
{
90
95
return $ this ->getCurrent () ||
91
- preg_replace (' /(\/index|(\/))+($|\/$)/ ' , '' , $ this ->getUrl ($ this ->getPath ()))
92
- == preg_replace (' /(\/index|(\/))+($|\/$)/ ' , '' , $ this ->getUrl ($ this ->getMca ()));
96
+ preg_replace (self :: REGEX_INDEX_URL_PATTERN , '' , $ this ->getUrl ($ this ->getPath ()))
97
+ == preg_replace (self :: REGEX_INDEX_URL_PATTERN , '' , $ this ->getUrl ($ this ->getMca ()));
93
98
}
94
99
95
100
/**
You can’t perform that action at this time.
0 commit comments