aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php12
1 files changed, 7 insertions, 5 deletions
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 {