Opened 6 years ago
Closed 6 years ago
#45468 closed defect (bug) (fixed)
Language_Pack_Upgrader should delete existing language files
Reported by: | ocean90 | Owned by: | ocean90 |
---|---|---|---|
Milestone: | 5.1 | Priority: | normal |
Severity: | normal | Version: | 5.0 |
Component: | Upgrade/Install | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
Translations in JSON format are stored in a file named <locale>-<hash-of-file-path>.json
. This means if the file is removed or renamed the hash will change too and the old file is no longer used. To avoid filling up the disk with unnecessary files the upgrader should remove all existing files first.
Attachments (2)
Change History (10)
#6
@
6 years ago
Hey @ocean90,
Just reviewing 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 expected.
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.
#7
@
6 years ago
Thanks for the feedback @dd32! Added 45468.2.diff to use WP_LANG_DIR
for the glob()
call.
5.0.3 is going to be released in a couple of weeks. We are currently sorting the remaining tickets in the milestone. It doesn't appear that ticket can be handled in the next couple of days (still needs a patch). Let's address it in 5.1 which is coming in February. Feel free to change/ask to change the milestone if you think the issue can be quickly resolved.