Repository navigation
Conversation
…ype. On the classic path, the image editor writes sub-sizes to disk directly, so a network that does not allow WebP uploads still gets WebP sub-sizes when `image_editor_output_format` asks for them. With client-side media processing, the browser transcodes each sub-size to that format and sideloads it, and the sideload is checked against the network's allowed upload file types, so it is rejected with "Sorry, you are not allowed to upload this file type." Networks created before WordPress 5.8 have no `webp` in `upload_filetypes`, and upgrades never add it. The first test is the classic baseline and passes. The second fails until the sideload endpoint allows the attachment's own output format. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds two multisite tests showing that client-side media processing rejects sub-sizes the server would have generated itself, when they are in an output format the network does not allow for upload.
test_server_sub_sizes_in_output_format_not_allowed_by_network()(passes): withupload_filetypesset tojpg jpeg png gifand animage_editor_output_formatfilter mapping JPEG to WebP, the image editor writes a WebP thumbnail. Sub-sizes go straight to disk, so the network's file types never apply.test_sideload_sub_size_in_output_format_not_allowed_by_network()(fails): the same WebP thumbnail, sideloaded as the browser would after transcoding it toimage_output_format, is checked against the allowed types and rejected:Networks created before WordPress 5.8 have no
webpinupload_filetypes(and none before 6.5 haveavif), and upgrades never add them. On those networks, every sub-size of a JPEG upload fails with a WebP or AVIF output plugin active, so the whole upload fails.The tests are tagged
ms-required. To run them:npm run test:php -- -c tests/phpunit/multisite.xml --filter not_allowed_by_networkTests only, no fix yet. One option is to allow the attachment's own
image_output_formatduring a sideload.Trac ticket: TBD
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Investigating the issue while reviewing #15512, and drafting the tests and this description. To be reviewed by me.
🤖 Generated with Claude Code
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.