WordPress.org

Make WordPress Core

Ticket #12036: wp_import-skip_file_size_check.txt

File wp_import-skip_file_size_check.txt, 788 bytes (added by stelund, 4 years ago)

Proposed diff to fix the bug

Line 
1Index: wp-admin/import/wordpress.php
2===================================================================
3--- wp-admin/import/wordpress.php       (revision 12835)
4+++ wp-admin/import/wordpress.php       (working copy)
5@@ -698,10 +698,6 @@
6                        @unlink($upload['file']);
7                        return new WP_Error( 'import_file_error', sprintf(__('Remote file returned error response %1$d %2$s'), $headers['response'], get_status_header_desc($headers['response']) ) );
8                }
9-               elseif ( isset($headers['content-length']) && filesize($upload['file']) != $headers['content-length'] ) {
10-                       @unlink($upload['file']);
11-                       return new WP_Error( 'import_file_error', __('Remote file is incorrect size') );
12-               }
13 
14                $max_size = $this->max_attachment_size();
15                if ( !empty($max_size) and filesize($upload['file']) > $max_size ) {