Make WordPress Core


Ignore:
Timestamp:
04/14/2008 04:01:59 PM (19 years ago)
Author:
ryan
Message:

Use error handler instead of die when moving files to upload dir fails. Props simonwheatley. fixes #6450 for trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/file.php

    r7547 r7644  
    173173        // Move the file to the uploads dir
    174174        $new_file = $uploads['path'] . "/$filename";
    175         if ( false === @ move_uploaded_file( $file['tmp_name'], $new_file ) )
    176                 wp_die( printf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ));
     175        if ( false === @ move_uploaded_file( $file['tmp_name'], $new_file ) ) {
     176                return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) );
     177        }
    177178
    178179        // Set correct file permissions
Note: See TracChangeset for help on using the changeset viewer.