Skip to content

Commit

Permalink
Fix backups directory .htaccess deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
dvz committed May 1, 2024
1 parent b37b0c2 commit be4d223
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion admin/modules/tools/backupdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ function clear_overflow($fp, &$contents)
}

$file = basename($mybb->input['file']);
$ext = get_extension($file);

if(!trim($mybb->input['file']) || !file_exists(MYBB_ADMIN_DIR.'backups/'.$file))
if(!trim($mybb->input['file']) || !file_exists(MYBB_ADMIN_DIR.'backups/'.$file) || filetype(MYBB_ADMIN_DIR.'backups/'.$file) != 'file' || ($ext != 'gz' && $ext != 'sql'))
{
flash_message($lang->error_backup_doesnt_exist, 'error');
admin_redirect("index.php?module=tools-backupdb");
Expand Down

0 comments on commit be4d223

Please sign in to comment.