Fixed handling of empty selection for allowed BBCodes
authorAlexander Ebert <ebert@woltlab.com>
Wed, 8 Apr 2015 13:51:54 +0000 (15:51 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 8 Apr 2015 13:51:54 +0000 (15:51 +0200)
wcfsetup/install/files/lib/system/option/user/group/BBCodeSelectUserGroupOptionType.class.php

index ab6a25d2d027e74eace22a4ae3ae559fa18a7eee..947924d56af3eb4e4fe885f8ce9022c09109d881 100644 (file)
@@ -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);