File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 171
171
case 'scorm ' :
172
172
$ oScorm = new scorm ();
173
173
$ manifest = $ oScorm ->import_local_package ($ s , $ current_dir );
174
+ // The file was treated, it can now be cleaned from the temp dir
175
+ unlink ($ s );
174
176
if (!empty ($ manifest )) {
175
177
$ oScorm ->parse_manifest ($ manifest );
176
178
$ oScorm ->import_manifest (api_get_course_id (), $ _REQUEST ['use_max_score ' ]);
192
194
case 'aicc ' :
193
195
$ oAICC = new aicc ();
194
196
$ config_dir = $ oAICC ->import_local_package ($ s , $ current_dir );
197
+ // The file was treated, it can now be cleaned from the temp dir
198
+ unlink ($ s );
195
199
if (!empty ($ config_dir )) {
196
200
$ oAICC ->parse_config_files ($ config_dir );
197
201
$ oAICC ->import_aicc (api_get_course_id ());
211
215
break ;
212
216
case '' :
213
217
default :
218
+ // There was an error, clean the file from the temp dir
219
+ if (is_file ($ s )) {
220
+ unlink ($ s );
221
+ }
214
222
Display::addFlash (
215
223
Display::return_message (get_lang ('ScormUnknownPackageFormat ' ), 'warning ' )
216
224
);
You can’t perform that action at this time.
0 commit comments