diff options
| author | Eric Poirier | 2021-04-06 17:02:31 +0000 |
|---|---|---|
| committer | Eric Poirier | 2021-04-09 12:36:23 +0000 |
| commit | 59e91467d529f612fcb09ef83c2c009de470fbc7 (patch) | |
| tree | 0629961b40826282b82be86b4fc3c952dd9bf87a | |
| parent | ef8ce6c9511c867537b67de3f02471a50fd912ff (diff) | |
| download | eclipse.org-common-59e91467d529f612fcb09ef83c2c009de470fbc7.tar.gz eclipse.org-common-59e91467d529f612fcb09ef83c2c009de470fbc7.tar.xz eclipse.org-common-59e91467d529f612fcb09ef83c2c009de470fbc7.zip | |
Bug 572271 - Remove trailing slashes for the sidebar
Change-Id: Id761d31494ae2add701f2de7903696865b091f0f
Signed-off-by: Eric Poirier <eric.poirier@eclipse-foundation.org>
| -rw-r--r-- | classes/themes/baseTheme.class.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/classes/themes/baseTheme.class.php b/classes/themes/baseTheme.class.php index 58544a47..7c1d6f06 100644 --- a/classes/themes/baseTheme.class.php +++ b/classes/themes/baseTheme.class.php @@ -2129,7 +2129,17 @@ EOHTML; $variables['#items'][$parent_item]['children'][] = $link; } - if ($_SERVER['REQUEST_URI'] === $link->getUrl()) { + // Removing trailing slashes + $uri = $_SERVER['REQUEST_URI']; + if(substr($uri, -1) == '/') { + $uri = substr($uri, 0, -1); + } + $nav_url = $link->getUrl(); + if(substr($nav_url, -1) == '/') { + $nav_url = substr($nav_url, 0, -1); + } + + if ($uri === $nav_url) { $variables['#items'][$parent_item]['classes'] = "in"; } } |
