Fixed infinite inverse integer
authorAlexander Ebert <ebert@woltlab.com>
Fri, 12 Jul 2013 20:43:27 +0000 (22:43 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 12 Jul 2013 20:43:27 +0000 (22:43 +0200)
wcfsetup/install/files/lib/system/option/user/group/InfiniteInverseIntegerUserGroupOptionType.class.php

index f1d4c1ae2ed78c1ea0b86be9541eec89eb780e84..1a39faaa555516cdd6576280bc6c925097486214 100644 (file)
@@ -19,10 +19,14 @@ class InfiniteInverseIntegerUserGroupOptionType extends InverseIntegerUserGroupO
         * @see wcf\system\option\user\group\IUserGroupOptionType::merge()
         */
        public function merge($defaultValue, $groupValue) {
-               if (($defaultValue == -1 && $groupValue == -1) || ($defaultValue == $groupValue)) {
+               if ($groupValue == -1 || $defaultValue == $groupValue) {
                        return null;
                }
                
+               if ($defaultValue == -1) {
+                       return $groupValue;
+               }
+               
                return min($defaultValue, $groupValue);
        }
 }