We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 635db99 commit 90a941dCopy full SHA for 90a941d
1 file changed
bea-logger.php
@@ -194,7 +194,15 @@ private function maybe_zip_rotated_file( $rotated_path ) {
194
return;
195
}
196
197
- $zip->addFile( $rotated_path, basename( $rotated_path ) );
+ $entry_name = basename( $rotated_path );
198
+ // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase -- ZipArchive API property.
199
+ if ( ! $zip->addFile( $rotated_path, $entry_name ) || $zip->numFiles < 1 ) {
200
+ $zip->close();
201
+ if ( is_file( $zip_path ) ) {
202
+ unlink( $zip_path );
203
+ }
204
+ return;
205
206
207
if ( ! $zip->close() ) {
208
if ( is_file( $zip_path ) ) {
0 commit comments