web/wp-admin/includes/import.php
branchwordpress
changeset 132 4d4862461b8d
parent 109 03b0d1493584
equal deleted inserted replaced
131:a4642baaf829 132:4d4862461b8d
    57  * @since 2.0.0
    57  * @since 2.0.0
    58  *
    58  *
    59  * @return array
    59  * @return array
    60  */
    60  */
    61 function wp_import_handle_upload() {
    61 function 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 
    62 	$overrides = array( 'test_form' => false, 'test_type' => false );
    67 	$overrides = array( 'test_form' => false, 'test_type' => false );
    63 	$_FILES['import']['name'] .= '.txt';
    68 	$_FILES['import']['name'] .= '.txt';
    64 	$file = wp_handle_upload( $_FILES['import'], $overrides );
    69 	$file = wp_handle_upload( $_FILES['import'], $overrides );
    65 
    70 
    66 	if ( isset( $file['error'] ) )
    71 	if ( isset( $file['error'] ) )