public function validateSubmitValue($value) {

        if (!$this->allowall) {
            // Assert that there is an actual list provided.
            $normalized = $this->util->normalize_file_types($value['filetypes']);
            if (empty($normalized) || $normalized == ['*']) {
                return get_string('filetypesnotall', 'core_form');
            }
        }

        if (!$this->allowunknown) {
            // Assert that all file types are known.
            $unknown = $this->util->get_unknown_file_types($value['filetypes']);

            if ($unknown) {
                return get_string('filetypesunknown', 'core_form', implode(', ', $unknown));
            }
        }

        if ($this->onlytypes) {
            // Assert that all file types are allowed here.
            $notwhitelisted = $this->util->get_not_whitelisted($value['filetypes'], $this->onlytypes);

            if ($notwhitelisted) {
                return get_string('filetypesnotwhitelisted', 'core_form', implode(', ', $notwhitelisted));
            }
        }

        return;
    }