[wp-trac] [WordPress Trac] #35485: "Delete Permantently" Only Deletes Original Size (UTF-8 file names)

WordPress Trac noreply at wordpress.org
Sat Jan 16 02:24:21 UTC 2016


#35485: "Delete Permantently" Only Deletes Original Size (UTF-8 file names)
--------------------------+-----------------------------
 Reporter:  Pamela1991    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  4.4.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When deleting uploaded media files with UTF-8 file names, upon permanently
 deleting these files, only the original full size image is deleted,
 whereas all re-sized variants are not deleted.

 Steps to reproduce this issue:

 1. Upload New Media file titled '''صورة.jpg''' via http://domain.com/wp-
 admin/media-new.php
 2. Delete Permanently from Media Library
 3. Navigate to FTP directory and only the original full-size picture will
 have been deleted. All re-sized versions remain.

 There is a similar ticket, but it is incorrectly titled/described as being
 an issue with [https://core.trac.wordpress.org/ticket/33227 diacritics in
 filename]. However, this is a UTF-8 problem.

 I tried modifying wp_delete_attachment() in post.php by changing the
 following lines to no avail:

 {{{#!php
 <?php
 4703     $meta = utf8_encode(wp_get_attachment_metadata( $post_id ));
 4704     $backup_sizes = utf8_encode(get_post_meta( $post->ID,
 '_wp_attachment_backup_sizes', true ));
 4752     $thumbfile = mb_ereg_replace(basename($file), $meta['thumb'],
 $file);
 4762     $intermediate_file = mb_ereg_replace( basename( $file ),
 $sizeinfo['file'], $file );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35485>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list