Bug #82670

EXT:form setting allowedMimeTypes not respects empty

Added by Maik Hagenbruch about 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Form Framework
Start date:
2017-10-04
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I set up a form and want to allow all mime types.
I tried many things.
I let the list with allowedMimeTypes empty, removed the whole property, wrote an '*'.
But nothing.
The check for that checks only if the set value is in the array of $allowedMimeTypes.

I added a little thing in TYPO3\CMS\Form\Mvc\Validation\MimeTypeValidator

if(count($allowedMimeTypes) 1 && $allowedMimeTypes[0] '*') {
return;
}

So the config could be this:

properties:
allowedMimeTypes:
- '*'

Maybe there is an other solution but i dont find it. oO

Associated revisions

Revision 58e155ac (diff)
Added by Ralf Zimmermann over 1 year ago

[BUGFIX] Respect empty allowedMimeTypes for file uploads

Make it possible to allow all mime types (except php) within file upload
form elements.
Since there are some default mime types configured within the ext:form
standard setup, you have to remove this default mime types within your
form definition (or reconfigure the default values within your custom
ext:form setup).

FileUpload:

properties:
allowedMimeTypes:
0: null
1: null
2: null
3: null

ImageUpload:

properties:
allowedMimeTypes:
0: null
1: null
2: null

Releases: master, 8.7
Resolves: #82670
Change-Id: Ifa07cceb47978b913f36b8607d4df4724ae22eef
Reviewed-on: https://review.typo3.org/55869
Tested-by: TYPO3com <>
Reviewed-by: Joerg Boesche <>
Reviewed-by: Tobi Kretschmann <>
Reviewed-by: Steffen Frese <>
Reviewed-by: Frank Naegler <>
Tested-by: Frank Naegler <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>

Revision b85a1a52 (diff)
Added by Ralf Zimmermann over 1 year ago

[BUGFIX] Respect empty allowedMimeTypes for file uploads

Make it possible to allow all mime types (except php) within file upload
form elements.
Since there are some default mime types configured within the ext:form
standard setup, you have to remove this default mime types within your
form definition (or reconfigure the default values within your custom
ext:form setup).

FileUpload:

properties:
allowedMimeTypes:
0: null
1: null
2: null
3: null

ImageUpload:

properties:
allowedMimeTypes:
0: null
1: null
2: null

Releases: master, 8.7
Resolves: #82670
Change-Id: Ifa07cceb47978b913f36b8607d4df4724ae22eef
Reviewed-on: https://review.typo3.org/56197
Tested-by: TYPO3com <>
Reviewed-by: Stephan GroƟberndt <>
Reviewed-by: Ralf Zimmermann <>
Reviewed-by: Frank Naegler <>
Tested-by: Frank Naegler <>
Reviewed-by: Alexander Opitz <>
Tested-by: Alexander Opitz <>

History

#1 Updated by Maik Hagenbruch about 2 years ago

I set up a form and want to allow all mime types.
I tried many things.
I let the list with allowedMimeTypes empty, removed the whole property, wrote an '*'.
But nothing.
The check for that checks only if the set value is in the array of $allowedMimeTypes.

I added a little thing in TYPO3\CMS\Form\Mvc\Validation\MimeTypeValidator

if(count($allowedMimeTypes) 1 && $allowedMimeTypes0 '*') {
return;
}

So the config could be this:

properties:
allowedMimeTypes:
- '*'

Maybe there is an other solution but i dont find it. oO

Another thing.
In my yaml i dont have the MimeType Validator set, but this validator is always running i think.

#2 Updated by Bjoern Jacob almost 2 years ago

  • Assignee deleted (Bjoern Jacob)

#3 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55869

#4 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55869

#5 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55869

#6 Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55869

#7 Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56197

#8 Updated by Ralf Zimmermann over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#9 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF