From 8f4de4754d4dc23bf5afd295659207db51331aa3 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 8 Jun 2018 14:00:03 +0200 Subject: [PATCH] Comparison for `never` values for boolean options --- .../group/BooleanUserGroupOptionType.class.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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; + } } -- 2.20.1