[svn r12369] Updated messaging on unrecognized format.

Fixed a bug in preg_match expression whereby most packages were attributed 'aicc' type for no reason.
skala
Yannick Warnier 19 years ago
parent 1e622672f5
commit f9ff3eb9aa
  1. 4
      main/newscorm/learnpath.class.php
  2. 10
      main/upload/upload.scorm.php

@ -1739,8 +1739,8 @@ class learnpath {
$package_type = 'scorm';
break;//exit the foreach loop
}
elseif(preg_match('/aicc\//i',$thisContent['filename'])!==FALSE)
{//if found an aicc directory...
elseif(preg_match('/aicc\//i',$thisContent['filename'])!=false)
{//if found an aicc directory... (!= false means it cannot be false (error) or 0 (no match))
$package_type='aicc';
//break;//don't exit the loop, because if we find an imsmanifest afterwards, we want it, not the AICC
}

@ -8,9 +8,17 @@
/**
* Process the SCORM package and return to the SCORM tool
*/
$language_file = "scorm";
$cwdir = getcwd();
require('../newscorm/lp_upload.php');
//reinit current working directory as many functions in upload change it
chdir($cwdir);
header('location: ../newscorm/lp_controller.php?action=list&dialog_box='.urlencode(get_lang('UplUploadSucceeded')));
$error = api_failure::get_last_failure();
if($error=='not_a_learning_path')
{
$msg = urlencode(get_lang('UnknownPackageFormat'));
}else{
$msg = urlencode(get_lang('UplUploadSucceeded'));
}
header('location: ../newscorm/lp_controller.php?action=list&dialog_box='.$msg);
?>
Loading…
Cancel
Save