Make WordPress Core

Opened 16 years ago

Closed 12 years ago

#10568 closed enhancement (wontfix)

wp_upload_dir should return a WP_Error object on failure

Reported by: simonwheatley's profile simonwheatley Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9
Component: Upload Keywords: has-patch 2nd-opinion
Focuses: 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 16 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)

@simonwheatley
16 years ago

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

#1 follow-up: @dd32
16 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..

#2 in reply to: ↑ 1 @simonwheatley
12 years 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.)

#3 @nacin
12 years ago

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