From 863b0822b27d5e6fcae68a4aa2f72ef0f5e746ce Mon Sep 17 00:00:00 2001 From: David Saylor Date: Tue, 30 Aug 2022 15:31:46 -0800 Subject: [PATCH] MDL-75616 backup: Use standard temp directory for extraction --- admin/cli/restore_backup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/cli/restore_backup.php b/admin/cli/restore_backup.php index 46eccb2db4f..6ae69c01f91 100644 --- a/admin/cli/restore_backup.php +++ b/admin/cli/restore_backup.php @@ -80,8 +80,8 @@ if (!$category = $DB->get_record('course_categories', ['id' => $options['categor throw new \moodle_exception('invalidcategoryid'); } -$backupdir = "restore_" . uniqid(); -$path = $CFG->tempdir . DIRECTORY_SEPARATOR . "backup" . DIRECTORY_SEPARATOR . $backupdir; +$backupdir = restore_controller::get_tempdir_name(SITEID, $USER->id); +$path = make_backup_temp_directory($backupdir); cli_heading(get_string('extractingbackupfileto', 'backup', $path)); $fp = get_file_packer('application/vnd.moodle.backup');