From: Alexander Ebert Date: Fri, 8 Jun 2018 12:00:03 +0000 (+0200) Subject: Comparison for `never` values for boolean options X-Git-Tag: 3.0.17~25 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8f4de4754d4dc23bf5afd295659207db51331aa3;p=GitHub%2FWoltLab%2FWCF.git Comparison for `never` values for boolean options --- diff --git a/wcfsetup/install/files/lib/system/option/user/group/BooleanUserGroupOptionType.class.php b/wcfsetup/install/files/lib/system/option/user/group/BooleanUserGroupOptionType.class.php index cf006f816c..cb8127308d 100644 --- a/wcfsetup/install/files/lib/system/option/user/group/BooleanUserGroupOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/user/group/BooleanUserGroupOptionType.class.php @@ -57,4 +57,19 @@ class BooleanUserGroupOptionType extends BooleanOptionType implements IUserGroup return $groupValue; } + + /** + * @inheritDoc + */ + public function compare($value1, $value2) { + if ($value1 == $value2) { + return 0; + } + else if ($value1 == -1) { + // this is the `never` permission + return -1; + } + + return $value1 ? 1 : -1; + } }