WordPress.org

Make WordPress Core

Opened 13 months ago

Closed 13 months ago

Last modified 13 months ago

#23900 closed defect (bug) (fixed)

Post format image ID corrupted when updating post

Reported by: johnbillion Owned by: helen
Milestone: 3.6 Priority: normal
Severity: major Version: 3.6
Component: Post Formats Keywords: has-patch commit
Focuses: Cc:

Description

Steps to reproduce:

  1. Create an 'Image' format post, give it an image and save the post.
  2. Save the post again, with or without changing anything.
  3. Observe the image is broken.

Attachments (3)

23900.patch (826 bytes) - added by johnbillion 13 months ago.
23900.diff (965 bytes) - added by wonderboymusic 13 months ago.
23900.2.diff (1.5 KB) - added by helen 13 months ago.

Download all attachments as: .zip

Change History (8)

johnbillion13 months ago

comment:1 johnbillion13 months ago

  • Keywords has-patch dev-feedback added

The attached patch fixes the core issue, however it looks like there is some (redundant?) code in there that refers to an 'Image URL', which the post formats UI is not currently using. Might need to be looked at by someone more familiar with the post formats UI.

comment:2 wonderboymusic13 months ago

  • Keywords commit added; dev-feedback removed
  • Milestone changed from Awaiting Review to 3.6

yep - that was leftover from when it was a URL

wonderboymusic13 months ago

helen13 months ago

comment:3 helen13 months ago

absint() would give us 0 if the value is empty.

comment:4 helen13 months ago

  • Owner set to helen
  • Resolution set to fixed
  • Status changed from new to closed

In 23874:

Since post format meta for images now takes an attachment ID only, make sure we label it appropriately and don't do things like esc_url() the value. fixes #23900.

comment:5 SergeyBiryukov13 months ago

In 23878:

Use correct escaping function. see #23900.

Note: See TracTickets for help on using tickets.