Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Extension rule allows wrong files and disallows uppercased extensions #2532

@FrittenKeeZ

Description

@FrittenKeeZ

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:

  1. Add an image field to the top level of a page
  2. Set the validation rule to validate: 'ext:jpg,png'
  3. Try to add a example.PNG file with capital extension
  4. 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.
statamic-validation-error

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions