Enhanced file type validation#2798
Open
girishpanchal30 wants to merge 3 commits into
Open
Conversation
Contributor
Bundle Size Diff
|
Contributor
|
Plugin build for ff2d4fb is ready 🛎️!
|
There was a problem hiding this comment.
Pull request overview
This PR enhances server-side validation for uploaded files in the Otter Pro Form workflow by mapping the configured allowedFileTypes to MIME patterns and validating uploads via wp_match_mime_types().
Changes:
- Convert
allowedFileTypesentries into an$allowed_mimeslist using WordPress’ MIME map (wp_get_mime_types()), while supporting wildcard patterns likeimage/*. - Validate uploaded files by matching the detected MIME type against the derived allowlist.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
E2E TestsPlaywright Test Status: Performance ResultsserverResponse: {"q25":418,"q50":420,"q75":421.7,"cnt":10}, firstPaint: {"q25":449.6,"q50":471.55,"q75":493.5,"cnt":10}, domContentLoaded: {"q25":1522,"q50":1527.05,"q75":1548.6,"cnt":10}, loaded: {"q25":1522.5,"q50":1527.5,"q75":1549,"cnt":10}, firstContentfulPaint: {"q25":3233.6,"q50":3249.7,"q75":3281.6,"cnt":10}, firstBlock: {"q25":6599.7,"q50":6643.3,"q75":6747.7,"cnt":10}, type: {"q25":12.13,"q50":12.59,"q75":13.48,"cnt":10}, typeWithoutInspector: {"q25":11.86,"q50":12.09,"q75":12.55,"cnt":10}, typeWithTopToolbar: {"q25":16.77,"q50":17.4,"q75":18.46,"cnt":10}, typeContainer: {"q25":7.25,"q50":7.91,"q75":8.7,"cnt":10}, focus: {"q25":52.75,"q50":57.92,"q75":59.24,"cnt":10}, inserterOpen: {"q25":16.77,"q50":17.56,"q75":21.65,"cnt":10}, inserterSearch: {"q25":5.62,"q50":5.75,"q75":6.03,"cnt":10}, inserterHover: {"q25":2.48,"q50":2.66,"q75":2.86,"cnt":20}, loadPatterns: {"q25":1077.61,"q50":1099.64,"q75":1129.87,"cnt":10}, listViewOpen: {"q25":83.99,"q50":88.67,"q75":97.92,"cnt":10} |
Soare-Robert-Daniel
approved these changes
May 14, 2026
a2bca46 to
ff2d4fb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes https://github.com/Codeinwp/otter-internals/issues/245
Summary
Enhance the validation of uploaded file MIME types.
Checklist before the final review