WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#20786 closed defect (bug) (fixed)

Cache Race Window When Attaching Attachments to Posts

Reported by: mdawaffe Owned by: nacin
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.0
Component: Cache API Keywords: has-patch commit
Focuses: Cc:

Description

In wp-admin/upload.php's 'attach' case, there's a cache race window.

I've never encountered a problem, but clean_attachment_cache() should come after the update, not before.

See #11647.

Attachments (1)

20786.diff (859 bytes) - added by mdawaffe 3 years ago.

Download all attachments as: .zip

Change History (5)

@mdawaffe3 years ago

comment:1 @nacin3 years ago

  • Milestone changed from Awaiting Review to 3.5

comment:2 follow-up: @nacin3 years ago

  • Keywords commit added

Or maybe array_map( 'clean_attachment_cache', $attach )? :-)

comment:3 in reply to: ↑ 2 @mdawaffe3 years ago

Replying to nacin:

Or maybe array_map( 'clean_attachment_cache', $attach )? :-)

:) WFM.

comment:4 @nacin3 years ago

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

In [21605]:

Clean attachment cache after a manual update, not before. props mdawaffe. fixes #20786.

Note: See TracTickets for help on using tickets.