From 17fee8b5387da37a222758e880184da8ecc4e57f Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 25 Jun 2024 10:46:14 +0200 Subject: [PATCH] Maintenance: CommonCartridge: Avoid static call of Imscc13Import::execute() - refs BT#21709 --- main/common_cartridge/cc13_import.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main/common_cartridge/cc13_import.php b/main/common_cartridge/cc13_import.php index a276f8f6b7..5dd4088227 100644 --- a/main/common_cartridge/cc13_import.php +++ b/main/common_cartridge/cc13_import.php @@ -42,6 +42,7 @@ if ($form->validate()) { if (!in_array($extImportFile, $allowedFileMimetype)) { echo Display::return_message(get_lang('YouMustImportAFileAccordingToSelectedOption'), 'error'); } else { + // Unzip the whole archive into app/cache/imsccImport/, which is a *temporary* directory $baseDir = api_get_path(SYS_ARCHIVE_PATH); $uploadPath = 'imsccImport/'; $errors = []; @@ -58,7 +59,8 @@ if ($form->validate()) { // We detect if it is cc v1.3 $detected = Imscc13Import::detectFormat($filepath); if ($detected) { - Imscc13Import::execute($filepath); + $importObject = new Imscc13Import(); + $importObject->execute($filepath); Display::addFlash(Display::return_message(get_lang('IMSCCFileImported'), 'normal', false)); } }