From: Alexander Ebert Date: Wed, 20 Jul 2016 11:04:39 +0000 (+0200) Subject: Added support for disallowed bbcodes X-Git-Tag: 3.0.0_Beta_1~1033 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0cb4a1ad53f8d03508a864c5635bb32709497227;p=GitHub%2FWoltLab%2FWCF.git Added support for disallowed bbcodes --- 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;