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: simonwheatley 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)

wp_upload_dir error.diff (711 bytes) - added by simonwheatley 4 years ago.
Patch to have wp_upload_dir return a WP_Error object on failure to create the dir

Download all attachments as: .zip

Change History (4)

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

comment:1 follow-up: ↓ 2   dd324 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   simonwheatley3 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.)

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.