Skip to content

Commit

Permalink
bug fix: Updater deleting uploads files by bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
uzulla committed Mar 16, 2021
1 parent a8cc49c commit 53f0e4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/Model/SystemUpdateModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ public static function updateSystemByLocalZip(string $dist_zip_path)
$files_in_tmp_dir_public = glob($tmp_dir_public . '/{*,.[!.]*,..?*}', GLOB_BRACE);
foreach ($files_in_tmp_dir_public as $files_in_tmp_dir_public_row) {
// `user_uploads` will skip delete/copy.
if ($tmp_dir_app . "/user_uploads" === $files_in_tmp_dir_public_row) continue;
if ($tmp_dir_app . "/uploads" === $files_in_tmp_dir_public_row) continue;
if ($tmp_dir_public . "/user_uploads" === $files_in_tmp_dir_public_row) continue;
if ($tmp_dir_public . "/uploads" === $files_in_tmp_dir_public_row) continue;
// delete/reset dir/files.
static::rm_r($public_dir . substr($files_in_tmp_dir_public_row, strlen($tmp_dir_public) + 1));
static::copy_r($files_in_tmp_dir_public_row, WWW_DIR); // todo error handling
Expand Down

0 comments on commit 53f0e4e

Please sign in to comment.