Make WordPress Core

Changeset 7643


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

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

File:
1 edited

Legend:

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

    r7547 r7643  
    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.