From: Alexander Ebert Date: Fri, 16 Oct 2015 12:10:54 +0000 (+0200) Subject: Fixed handling of 'checkboxes' option type X-Git-Tag: 2.1.8~15 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3555965d80a3c1364fa5a092e6e6b439bd96b531;p=GitHub%2FWoltLab%2FWCF.git Fixed handling of 'checkboxes' option type --- diff --git a/wcfsetup/install/files/js/WCF.User.js b/wcfsetup/install/files/js/WCF.User.js index 278c65cd58..f99c3a9cca 100644 --- a/wcfsetup/install/files/js/WCF.User.js +++ b/wcfsetup/install/files/js/WCF.User.js @@ -1183,7 +1183,20 @@ WCF.User.Profile.Editor = Class.extend({ var $name = $element.attr('name'); if ($regExp.test($name)) { - $values[RegExp.$1] = ($value === null) ? $element.val() : $value; + var $fieldName = RegExp.$1; + if ($value === null) $value = $element.val(); + + // check for checkboxes + if (/\[\]$/.test($name)) { + if (!Array.isArray($values[$fieldName])) { + $values[$fieldName] = []; + } + + $values[$fieldName].push($value); + } + else { + $values[$fieldName] = $value; + } } });