From 24ed9ac3f84c908ba6ff6f2a9a16b1fe01470b7f Mon Sep 17 00:00:00 2001 From: SecretR Date: Mon, 4 Jan 2016 02:30:59 +0200 Subject: [PATCH] User class list now rendered as expected --- e107_handlers/userclass_class.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/e107_handlers/userclass_class.php b/e107_handlers/userclass_class.php index 104e2aaab..218d871fa 100644 --- a/e107_handlers/userclass_class.php +++ b/e107_handlers/userclass_class.php @@ -487,12 +487,9 @@ class user_class if ($optlist) { - $opt_arr = explode(',',$optlist); - } - foreach ($opt_arr as &$v) - { - $v = trim($v); + $opt_arr = array_map('trim', explode(',',$optlist)); } + $opt_arr = array_flip($opt_arr); // This also eliminates duplicates which could arise from applying the other options, although shouldn't matter if (isset($opt_arr['no-excludes'])) unset($opt_arr['no-excludes']); @@ -551,8 +548,9 @@ class user_class if (!array_key_exists($uc_id,$this->fixed_classes) && ( getperms('0') || ( - (!isset($optlist['matchclass']) || check_class($uc_id)) - && (!isset($optlist['filter']) || check_class($row['userclass_visibility'])) + (!isset($opt_arr['matchclass']) || check_class($uc_id)) + && + (!isset($opt_arr['filter']) || check_class($row['userclass_visibility'])) ) ) )