diff --git a/lib/adminlib.php b/lib/adminlib.php index 0e80d7c07d2..3a156375a06 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -3682,12 +3682,15 @@ class admin_setting_configmultiselect extends admin_setting_configselect { if (!is_array($data)) { return ''; //ignore it } - if (!$this->load_choices() or empty($this->choices)) { - return ''; - } unset($data['xxxxx']); + // Only reject when the caller actually supplied a value + // and there is no valid choices to validate against. + if (!empty($data) && (!$this->load_choices() || empty($this->choices))) { + return ''; + } + $save = array(); foreach ($data as $value) { if (!array_key_exists($value, $this->choices)) {