Added support for disallowed bbcodes
authorAlexander Ebert <ebert@woltlab.com>
Wed, 20 Jul 2016 11:04:39 +0000 (13:04 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 20 Jul 2016 11:04:48 +0000 (13:04 +0200)
wcfsetup/install/files/lib/system/option/user/group/BBCodeSelectUserGroupOptionType.class.php

index 284d83cc5a427a2b92cfce1587cfd73e831ac344..b533ea903d87f4615a97e4922737676a2fa44206 100644 (file)
@@ -119,9 +119,7 @@ class BBCodeSelectUserGroupOptionType extends AbstractOptionType implements IUse
         * @inheritDoc
         */
        public function compare($value1, $value2) {
-               // TODO: fix this
-               
-               // handle special case where no allowed BBCodes have been set
+               // handle special case where no disallowed BBCodes have been set
                if (empty($value1)) {
                        if (empty($value2)) {
                                return 0;
@@ -136,26 +134,13 @@ class BBCodeSelectUserGroupOptionType extends AbstractOptionType implements IUse
                $value1 = explode(',', $value1);
                $value2 = explode(',', $value2);
                
-               // handle special 'all' value
-               if (in_array('all', $value1)) {
-                       if (in_array('all', $value2)) {
-                               return 0;
-                       }
-                       else {
-                               return 1;
-                       }
-               }
-               else if (in_array('all', $value2)) {
-                       return -1;
-               }
-               
-               // check if value1 contains more BBCodes than value2
+               // check if value1 disallows more BBCodes than value2
                $diff = array_diff($value1, $value2);
                if (!empty($diff)) {
                        return 1;
                }
                
-               // check if value1 contains less BBCodes than value2
+               // check if value1 disallows less BBCodes than value2
                $diff = array_diff($value2, $value1);
                if (!empty($diff)) {
                        return -1;