Skip to content

Commit

Permalink
Fix issue with empty language pack ZIP (wearerequired#169)
Browse files Browse the repository at this point in the history
* Use ZipArchive::CREATE | ZipArchive::OVERWRITE for open() method
  • Loading branch information
florianbrinkmann authored Mar 3, 2020
1 parent 706ea69 commit 4703b0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inc/ZipProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function generate_zip_file() : bool {

$temp_zip_file = wp_tempnam( $this->get_zip_filename() );

if ( $zip->open( $temp_zip_file, ZipArchive::CREATE ) === true ) {
if ( $zip->open( $temp_zip_file, ZipArchive::CREATE | ZipArchive::OVERWRITE ) === true ) {
foreach ( $files_for_zip as $file_name => $temp_file ) {
$zip->addFile( $temp_file, $file_name );
}
Expand Down

0 comments on commit 4703b0b

Please sign in to comment.