Skip to content

Commit 3842c42

Browse files
committed
fix(backup): add file existence check for wp-config backup
Add missing file existence check in backup_wp_content_dir() for consistency with other backup functions. This ensures the archive was actually created even when 7z returns exit code 0 or 1. Addresses GitHub Copilot review feedback on PR #473.
1 parent 184358d commit 3842c42

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/helper/Site_Backup_Restore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ private function backup_wp_content_dir( $backup_dir ) {
480480
$result = EE::launch( $backup_command );
481481

482482
// 7z exit codes: 0=success, 1=warning (non-fatal), 2+=fatal error
483-
if ( $result->return_code >= 2 ) {
483+
if ( $result->return_code >= 2 || ! $this->fs->exists( $backup_file ) ) {
484484
$this->capture_error(
485485
'Failed to create WordPress content backup archive',
486486
self::ERROR_TYPE_FILESYSTEM,

0 commit comments

Comments
 (0)