[wp-trac] [WordPress Trac] #30052: Add New Media Drag and Drop Hangs on Crunching

WordPress Trac noreply at wordpress.org
Mon Nov 24 18:44:40 UTC 2014


#30052: Add New Media Drag and Drop Hangs on Crunching
-------------------------------+-----------------------------
 Reporter:  Gregory_Lang       |       Owner:
     Type:  defect (bug)       |      Status:  closed
 Priority:  low                |   Milestone:
Component:  Media              |     Version:  4.0
 Severity:  major              |  Resolution:  worksforme
 Keywords:  reporter-feedback  |     Focuses:  administration
-------------------------------+-----------------------------

Comment (by bobbingwide):

 Just to confirm that I have performed "ALTER TABLE wp_posts AUTO_INCREMENT
 =1000;"
 but didn't get the problem.
 When I tried to reset the value to a number below 1000 the new post IDs
 were still above 1000.


 However... on another site, while investigating the placement of the
 crunching red herring I did get


 `
 <br />
 <b>Notice</b>:  Undefined index: extension in <b>/home/herb/public_html
 /wp-includes/class-wp-image-editor.php</b> on line <b>360</b><br />
 <br />
 <b>Notice</b>:  Undefined index: extension in <b>/home/herb/public_html
 /wp-includes/class-wp-image-editor.php</b> on line <b>360</b><br />
 18948
 `

 This is with WP_DEBUG( 'true' );

 The file I was uploading is called !.jpg

 I can't reproduce the problem with PHP 5.5.18 on a Windows server
 but on PHP 5.3.29, Linux the target file simply becomes jpg''n'' with a
 thumbnail called jpg''n''-300x182.


 0. bw_lazy_backtrace /home/herb/public_html/wp-
 content/plugins/oik/bwtrace.inc:60 0
 1. bw_backtrace /home/herb/public_html/wp-includes/class-wp-image-
 editor.php:358 0
 2. generate_filename(,,) /home/herb/public_html/wp-includes/class-wp-
 image-editor-imagick.php:451 3
 3. _save(object) /home/herb/public_html/wp-includes/class-wp-image-editor-
 imagick.php:301 1
 4. multi_resize(Array) /home/herb/public_html/wp-
 admin/includes/image.php:120 1
 5. wp_generate_attachment_metadata(18952,/home/herb/public_html/wp-
 content/uploads/2014/11/jpg6) /home/herb/public_html/wp-
 admin/includes/media.php:345 2
 6. media_handle_upload(async-upload,0) /home/herb/public_html/wp-admin
 /async-upload.php:87 2

 /home/herb/public_html/wp-includes/class-wp-image-editor.php(357:0)
 2014-11-24T17:54:29+00:00 89 cf! 39 0 58629568/58836616
 generate_filename(8) 3 Array
 (
     [0] =>
     [1] =>
     [2] =>
 )

 /home/herb/public_html/wp-includes/class-wp-image-editor.php(357:0)
 2014-11-24T17:54:29+00:00 90 cf! 39 0 58629608/58838952
 generate_filename(10) this_file WP_Image_Editor_Imagick Object
 (
     [image:protected] => Imagick Object
         (
         )

     [file:protected] => /home/herb/public_html/wp-
 content/uploads/2014/11/jpg6
     [size:protected] => Array
         (
             [width] => 300
             [height] => 182
         )

     [mime_type:protected] => image/jpeg
     [default_mime_type:protected] => image/jpeg
     [quality:protected] =>
     [default_quality:protected] => 90
 )


 $_FILES in media_handle_upload is
 /home/herb/public_html/wp-admin/includes/media.php(255:0)
 2014-11-24T18:10:14+00:00 84 cf! 27 0 58259600/58443960
 media_handle_upload(2) 2 Array
 (
     [0] => async-upload
     [1] => 0
 )

 /home/herb/public_html/wp-admin/includes/media.php(255:0)
 2014-11-24T18:10:14+00:00 85 cf! 27 0 58259640/58443960
 media_handle_upload(4) files Array
 (
     [async-upload] => Array
         (
             [name] => !.jpg
             [type] => image/jpeg
             [tmp_name] => /tmp/phpaVY9vv
             [error] => 0
             [size] => 88711
         )

 )

 It would appear that sanitize_file_name() is to blame - reducing the file
 to
 /home/herb/public_html/wp-includes/formatting.php(1077:0)
 2014-11-24T18:42:51+00:00 99 cf! 27 0 58282560/58446624
 sanitize_file_name(16) parts! Array
 (
     [0] => jpg
 )

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30052#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list