Fixed disallowing bbcodes
authorAlexander Ebert <ebert@woltlab.com>
Thu, 15 Sep 2016 15:18:04 +0000 (17:18 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 15 Sep 2016 15:18:10 +0000 (17:18 +0200)
wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php
wcfsetup/install/files/lib/system/option/user/group/BBCodeSelectUserGroupOptionType.class.php

index 9fa4e9b7d0f6a1404d6c5262001b2e1822dc77c8..7cce788f814001de199886896f994451e783eb55 100644 (file)
@@ -184,6 +184,13 @@ class UserGroupOptionForm extends AbstractForm {
                                }
                        }
                }
+               else if ($this->userGroupOption->optionType == 'BBCodeSelect') {
+                       foreach ($this->groups as $groupID => $group) {
+                               if (!isset($this->values[$groupID])) {
+                                       $this->values[$groupID] = '';
+                               }
+                       }
+               }
                
                if (!empty($this->errorType)) {
                        throw new UserInputException('optionValues', $this->errorType);
index 900ccbecd8bf06ec36942814fa072be258e4e3c5..3b683e4c9cf3a299324cc6e3311624221276bad0 100644 (file)
@@ -90,7 +90,7 @@ class BBCodeSelectUserGroupOptionType extends AbstractOptionType implements IUse
                        $groupValue = explode(',', StringUtil::unifyNewlines($groupValue));
                }
                
-               $newValue = array_unique(array_merge($defaultValue, $groupValue));
+               $newValue = array_intersect($defaultValue, $groupValue);
                sort($newValue);
                
                return implode(',', $newValue);