[codex] Cover media MIME drift in merge validators#214
Merged
Conversation
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.
What it does
Adds focused media-validator coverage for WordPress attachment
post_mime_typedrift. A staged.jpgupload declared asapplication/pdfnow produces a plugin-scopedplugin-wp-media-mime-driftaudit conflict.Rationale
Uploads are a DB-plus-files semantic object. The existing validator checked attachment metadata, upload paths, generated sizes, file ownership, and filesize drift, but did not cover the attachment row's MIME metadata. A merge that leaves
wp_posts.post_mime_typeinconsistent with the uploaded file should be review-visible instead of silently accepted by the validator.Implementation
tests/cow/media_validator.phpnow:post_mime_typein the attachment fixture schema,jpg,jpeg,png,gif,webp) againstpost_mime_type,plugin-wp-media-mime-driftwith declared and expected MIME evidence.docs/merge-reliability.mdnow lists this as covered upload validator evidence.Testing instructions
php -l tests/cow/media_validator.phpmake test-cow-media-validatormake test-cow-semantic-fastgit diff --check origin/trunk...HEAD