From 0cb4a1ad53f8d03508a864c5635bb32709497227 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 20 Jul 2016 13:04:39 +0200 Subject: [PATCH] Added support for disallowed bbcodes --- .../BBCodeSelectUserGroupOptionType.class.php | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/wcfsetup/install/files/lib/system/option/user/group/BBCodeSelectUserGroupOptionType.class.php b/wcfsetup/install/files/lib/system/option/user/group/BBCodeSelectUserGroupOptionType.class.php index 284d83cc5a..b533ea903d 100644 --- a/wcfsetup/install/files/lib/system/option/user/group/BBCodeSelectUserGroupOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/user/group/BBCodeSelectUserGroupOptionType.class.php @@ -119,9 +119,7 @@ class BBCodeSelectUserGroupOptionType extends AbstractOptionType implements IUse * @inheritDoc */ public function compare($value1, $value2) { - // TODO: fix this - - // handle special case where no allowed BBCodes have been set + // handle special case where no disallowed BBCodes have been set if (empty($value1)) { if (empty($value2)) { return 0; @@ -136,26 +134,13 @@ class BBCodeSelectUserGroupOptionType extends AbstractOptionType implements IUse $value1 = explode(',', $value1); $value2 = explode(',', $value2); - // handle special 'all' value - if (in_array('all', $value1)) { - if (in_array('all', $value2)) { - return 0; - } - else { - return 1; - } - } - else if (in_array('all', $value2)) { - return -1; - } - - // check if value1 contains more BBCodes than value2 + // check if value1 disallows more BBCodes than value2 $diff = array_diff($value1, $value2); if (!empty($diff)) { return 1; } - // check if value1 contains less BBCodes than value2 + // check if value1 disallows less BBCodes than value2 $diff = array_diff($value2, $value1); if (!empty($diff)) { return -1; -- 2.20.1