From dfe63b48a4473f2f3d72e10a446fc3c0f3312a34 Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 14 Aug 2008 15:56:42 +0000 Subject: Fixed an issue with the submenu. git-svn-id: https://code.elgg.org/elgg/trunk@1923 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'engine/lib/elgglib.php') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index a367707b3..06bc9540a 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -561,17 +561,19 @@ foreach($submenu_register_group as $key => $item) { - $comparevals[$key] = (levenshtein($item->value, $_SERVER['REQUEST_URI'])); - if ($comparevals[$key] < $maxcompareval) { - $maxcompareval = $comparevals[$key]; - $preselected = $key; + if (substr_count($item->value, $_SERVER['REQUEST_URI'])) { + $comparevals[$key] = levenshtein($item->value, $_SERVER['REQUEST_URI']); + if ($comparevals[$key] < $maxcompareval) { + $maxcompareval = $comparevals[$key]; + $preselected = $key; + } } } foreach($submenu_register_group as $key => $item) { - if (!$preselected) { + if ($preselected === false) { if (substr_count($item->value, $_SERVER['REQUEST_URI'])) { $selected = true; } else { -- cgit v1.2.3