Skip to content

Conversation

@Phocacius
Copy link
Member

Adds a file extension check to uploaded files. The configuration key is allowedFileTypes. It expects a comma-separated list of allowed extensions (ignoring case). If unset, all files are allowed (as it was before).

Example config:

-
  type: file
  text: 'Upload an image'
  name: image
  allowedFileTypes: 'jpeg, jpg, png'

⚠️ Only the filename extension is checked, not the actual content.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds file type validation for file uploads in forms by introducing a new allowedFileTypes configuration option. The validation is based on file extension matching (case-insensitive) and displays translated error messages when invalid file types are uploaded.

  • Implements client-side file extension validation using the allowedFileTypes configuration key
  • Adds error message translations across 11 languages for invalid file type feedback
  • Updates JavaScript to use modern const declarations and arrow functions

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

File Description
src/Mapbender/DataManagerBundle/Resources/public/FormRenderer.js Implements file extension validation logic and updates variable declarations to const
src/Mapbender/DataManagerBundle/Resources/translations/messages.*.yaml Adds "invalid_file_extension" error message translations for 11 languages
CHANGELOG.md Documents the new feature addition

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@astroidex astroidex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • tested. works fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants