Make WordPress Core

Changeset 11963


Ignore:
Timestamp:
09/23/2009 07:06:58 AM (17 years ago)
Author:
westi
Message:

Handle the file upload case on import when post_max_size is smaller than upload_max_filesize and no POST data arrives at all. Fixes #10830.

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

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

    r11930 r11963  
    266266        // A non-empty file will pass this test.
    267267        if ( $test_size && !($file['size'] > 0 ) )
    268                 return $upload_error_handler( $file, __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini.' ));
     268                return $upload_error_handler( $file, __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' ));
    269269
    270270        // A properly uploaded file will pass this test. There should be no reason to override this one.
  • trunk/wp-admin/includes/import.php

    r10611 r11963  
    6060 */
    6161function wp_import_handle_upload() {
     62        if ( !isset($_FILES['import']) ) {
     63                $file['error'] = __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' ); 
     64                return $file;
     65        }
     66       
    6267        $overrides = array( 'test_form' => false, 'test_type' => false );
    6368        $_FILES['import']['name'] .= '.txt';
Note: See TracChangeset for help on using the changeset viewer.