WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#6450 closed defect (bug) (fixed)

wp_handle_upload does not appear to handle file move errors correctly

Reported by: simonwheatley Owned by: andy
Milestone: 2.5.1 Priority: normal
Severity: normal Version: 2.5
Component: General Keywords: has-patch needs-testing
Focuses: Cc:

Description

wp_handle_upload uses a configurable error handler for all errors, except in the case where it fails to move the file to the uploads directory. I think this is an ommission, which the attached patch fixes. The patch also corrects an instance of printf to sprintf.

To reproduce:

  1. Set your upload directory & subdirectories to readonly (chmod -R 444 /your/uploads/)
  1. Attempt to upload a file through the 2.5 SWF uploader
  1. Observe the generic error message "An error occurred in the upload. Please try again later."

Attachments (1)

file_upload_move_error.patch (700 bytes) - added by simonwheatley 6 years ago.
Patch to fix uploaded file movement error notification

Download all attachments as: .zip

Change History (6)

simonwheatley6 years ago

Patch to fix uploaded file movement error notification

comment:1 AaronCampbell6 years ago

  • Keywords has-patch needs-testing added; has_patch needs_testing removed

The keywords use hyphens rather than underscores. I fixed it, but here is a link to look up keywords:
http://codex.wordpress.org/Reporting_Bugs#Trac_Keywords

comment:2 ryan6 years ago

  • Owner changed from anonymous to andy

comment:3 simonwheatley6 years ago

Thanks Aaron. I did read that page, but then my brain obviously switched off and I ended up with typos!

comment:4 ryan6 years ago

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

(In [7643]) Use error handler instead of die when moving files to upload dir fails. Props simonwheatley. fixes #6450 for 2.5

comment:5 ryan6 years ago

(In [7644]) Use error handler instead of die when moving files to upload dir fails. Props simonwheatley. fixes #6450 for trunk

Note: See TracTickets for help on using tickets.