From 9e06d495ec642e1c5ec5b49c6ba596cce564ec35 Mon Sep 17 00:00:00 2001 From: Kanti Date: Wed, 6 Aug 2014 07:02:00 +0200 Subject: [PATCH] active link bugfixed --- system/includes/functions.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/system/includes/functions.php b/system/includes/functions.php index 8ebb630..7672f1e 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -1133,10 +1133,8 @@ function get_menu() {//aktive Link for Sub Pages ::TODO $url = site_url() . str_replace('.md', '', $base); $title = get_title_from_file($v); - - $reqBase = str_replace(substr($req, 0, strrpos($req, '/')) . '/', '', $req); - if ($reqBase == str_replace('.md', '', $base)) { + if ($req == site_path() . "/" . str_replace('.md', '', $base)) { $active = ' active'; $reqBase = ''; } else { @@ -1165,7 +1163,8 @@ function get_menu() {//aktive Link for Sub Pages ::TODO } $replacedSub = substr($sp, 0, strrpos($sp, '/')) . '/'; $baseSub = str_replace($replacedSub, '', $sp); - if ($reqBase == str_replace('.md', '', $baseSub)) { + + if ($req == site_path() . "/" . str_replace('.md', '', $base) . "/" . str_replace('.md', '', $baseSub)) { $classSub .= ' active'; } $urlSub = $url . "/" . str_replace('.md', '', $baseSub);