Opened 4 years ago
Closed 3 months ago
#10568 closed enhancement (wontfix)
wp_upload_dir should return a WP_Error object on failure
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Upload | Version: | 2.9 |
| Severity: | normal | Keywords: | has-patch 2nd-opinion |
| Cc: |
Description
Currently wp_upload_dir returns an array with an 'error' index. I believe it should return a WP_Error object instead. The attached patch amends the behaviour.
Attachments (1)
Change History (4)
simonwheatley — 4 years ago
- Component changed from Filesystem to Upload
- Keywords 2nd-opinion added
- Milestone changed from Unassigned to Future Release
- Owner dd32 deleted
- Type changed from defect (bug) to enhancement
- Version set to 2.9
I do agree with you, But a LOT of plugins are written expecting an error element as a return, some do not even bother checking for that case too..
comment:2
in reply to:
↑ 1
simonwheatley — 3 months ago
Replying to dd32:
I do agree with you, But a LOT of plugins are written expecting an error element as a return, some do not even bother checking for that case too..
Is this a wontfix, then? (Which is fine, just doing my part to clear out trac.)
Note: See
TracTickets for help on using
tickets.

Patch to have wp_upload_dir return a WP_Error object on failure to create the dir