Issue Bug Closed

#73618EXT:form - Validator for allowed file types should ignore whitespaces in types list

Felix Heller 02/23/16, 12:06 updated 10/02/18, 11:18

Description

The validator FileAllowedTypesValidator expects a comma separated list with whitespaces:

public function setAllowedTypes($allowedTypes) {
    $allowedTypes = strtolower($allowedTypes);
    $this->allowedTypes = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(', ', $allowedTypes);
    return $this;
}

In my opinion it would be better if a simple comma separated list would work, too. A configuration like this does not work as expected:

types = application/pdf,image/jpeg

Reviews 3