Opened 13 years ago
Closed 13 years ago
#13965 closed defect (bug) (fixed)
wp_get_nocache_headers should always return an array
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | General | Keywords: | has-patch |
Focuses: | Cc: |
Description
Apparently sometimes plugins use its filter and don't return an array.
WP should instead cast filtered results to array, so it always returns an array.
Attachments (1)
Change History (7)
#2
@
13 years ago
The net number of casts to array is unchanged, just moved to make it more reliable.
In general, I think it's better to try to handle plugins' runtime errors (like this) gracefully, as opposed to say more "compile"-time errors (including the wrong file or using the wrong protocol, etc.).
That's because the latter kind of error is more likely to appear consistently during development and therefore get corrected. But the former might occur only in particular conditions.
#4
@
13 years ago
- Milestone Awaiting Triage deleted
- Resolution set to wontfix
- Status changed from accepted to closed
Note: See
TracTickets for help on using
tickets.
It's up to plugins to return a correctly formatted value. Why cast the return value of this one particular filter? Is it any different to the others?