v2-hub
v2-hub copied to clipboard
Extension rule allows wrong files and disallows uppercased extensions
Describe the bug
Given the extension rule ext:jpg,png
you're allowed to select example.apng
but not example.PNG
.
To Reproduce Steps to reproduce the behavior:
- Add an image field to the top level of a page
- Set the validation rule to
validate: 'ext:jpg,png'
- Try to add a
example.PNG
file with capital extension - See that the validation error occurs.
Expected behavior
Regardless of capitalization of extension a file should be allow - and files not matching extension including dot ( .
) shouldn't.
Screenshots If applicable, add screenshots to help explain your problem.
Environment details (please complete the following information):
- Statamic Version: 2.11.20
Additional context
It's a matter of correcting statamic/core/Providers/ValidationServiceProvider.php:97
.