[wp-trac] [WordPress Trac] #45468: Language_Pack_Upgrader should delete existing language files

WordPress Trac noreply at wordpress.org
Mon Jan 21 06:47:47 UTC 2019

#45468: Language_Pack_Upgrader should delete existing language files
 Reporter:  ocean90          |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  5.1
Component:  Upgrade/Install  |     Version:  5.0
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:

Comment (by dd32):

 Hey @ocean90,

 Just reviewing [attachment:"45468.diff"]
 `$remote_destination` is a path on the "remote" filesystem, as seen by FTP
 or others, as a result `glob( $remote_destination )` won't work as

 You can just use `glob( WP_LANG_DIR )` directly i instead to find out what
 files exist, but you'll have to iterate over the results to make them all
 relative to `$remote_destination` before acting upon them.

 The other option is to use `$wp_filesystem->dirlist( $remote_destination
 )` and filter through the listings directly there, but there's no real
 benefit in doing so (other than that's used elsewhere, for example in the
 base class `clear_destination()` ).

 That's the only thing I noticed in reading the patch, but haven't applied
 it for testing.

Ticket URL: <https://core.trac.wordpress.org/ticket/45468#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list