Skip to content

Validate built-in attachment image metadata shape#362

Merged
adamziel merged 1 commit into
trunkfrom
codex/builtin-upload-image-meta-shape
May 18, 2026
Merged

Validate built-in attachment image metadata shape#362
adamziel merged 1 commit into
trunkfrom
codex/builtin-upload-image-meta-shape

Conversation

@adamziel
Copy link
Copy Markdown
Contributor

What it does

Reports malformed _wp_attachment_metadata.image_meta through the built-in WordPress upload validator as plugin-wp-attachment-metadata-invalid-shape.

Rationale

The discovered media validator already caught malformed image_meta, but the production WordPress-scoped validator did not. That left a core attachment metadata shape invariant dependent on an optional mu-plugin validator.

Implementation

When readable attachment metadata contains image_meta and it is not an array, the built-in validator records a review-only invalid-shape conflict with:

  • field: _wp_attachment_metadata.image_meta
  • role: image-meta
  • value_type
  • the attachment upload path

The roadmap doc wording now reflects that upload metadata coverage comes from both discovered and built-in validators.

Testing instructions

php -l scripts/cow/merge.php
php -l tests/cow/media_validator.php
php tests/cow/media_validator.php
git diff --check

Report malformed _wp_attachment_metadata.image_meta through the built-in WordPress upload validator and keep the media validator regression coverage current.
@adamziel adamziel merged commit 8c9951d into trunk May 18, 2026
2 checks passed
@adamziel adamziel deleted the codex/builtin-upload-image-meta-shape branch May 18, 2026 18:26
@adamziel adamziel mentioned this pull request May 18, 2026
adamziel added a commit that referenced this pull request May 18, 2026
## Release `v0.1.42`

Version bump for `v0.1.42`.

**Changelog draft:**
* Tighten built-in upload metadata file validation (#361)
* Validate built-in attachment image metadata shape (#362)

**Full changelog:**

v0.1.41...release/v0.1.42

## Verification

* `git diff --check`
* `cargo metadata --no-deps --format-version 1`

## Next steps

Merging this PR prepares the release commit. Tagging the merged trunk
commit as `v0.1.42` will run the release workflow and publish binaries.

Co-authored-by: Codex <codex@openai.com>
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.

2 participants