From: Alexander Ebert Date: Wed, 8 Apr 2015 13:51:54 +0000 (+0200) Subject: Fixed handling of empty selection for allowed BBCodes X-Git-Tag: 2.1.3~23 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=882fab9c7c7e3ad3c21883479137387a1623e390;p=GitHub%2FWoltLab%2FWCF.git Fixed handling of empty selection for allowed 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 ab6a25d2d0..947924d56a 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 @@ -126,6 +126,18 @@ class BBCodeSelectUserGroupOptionType extends AbstractOptionType implements IUse * @see \wcf\system\option\IOptionType::compare() */ public function compare($value1, $value2) { + // handle special case where no allowed BBCodes have been set + if (empty($value1)) { + if (empty($value2)) { + return 0; + } + + return -1; + } + else if (empty($value2)) { + return 1; + } + $value1 = explode(',', $value1); $value2 = explode(',', $value2);