Opened 9 months ago

Closed 9 months ago

Last modified 8 months ago

#21835 closed defect (bug) (fixed)

wp_mime_type_icon() does wp_cache_set() when it should do wp_cache_add()

Reported by: nacin Owned by: nacin
Priority: normal Milestone: 3.5
Component: Media Version:
Severity: normal Keywords:
Cc:

Description

Really no reason for it to try an unconditional set, as it is only run when the get failed.

Additionally, $post_id is not set when passed to the filter if the get succeeds, as noted by koopersmith.

Change History (3)

In [21782]:

Ensure $post_id is defined in wp_mime_type_icon() to prevent notices when a valid mime type string is provided. see #21835.

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

In [21783]:

Use wp_cache_add() in wp_mime_type_icon(). fixes #21835.

The $post_id PHP notice was ticketed in #21614 (just putting it here so they can get linked together, as this one was the one where the fix was committed)

Note: See TracTickets for help on using tickets.