Permalink
Browse files

Fixed empty tags check

  • Loading branch information...
1 parent 586de5a commit d74b87919fa1d9a809271df855a312450e641d78 bobopinna committed Apr 12, 2006
Showing with 19 additions and 1 deletion.
  1. +19 −1 mod/scorm/locallib.php
@@ -905,7 +905,7 @@ function scorm_get_manifest($blocks,$scoes) {
foreach ($block['children'] as $metadata) {
if ($metadata['name'] == 'SCHEMAVERSION') {
if (empty($scoes->version)) {
- if (preg_match("/^(1\.2)$|^(CAM )?(1\.3)$/",$metadata['tagData'],$matches)) {
+ if (isset($metadata['tagData']) && (preg_match("/^(1\.2)$|^(CAM )?(1\.3)$/",$metadata['tagData'],$matches))) {
$scoes->version = 'SCORM_'.$matches[count($matches)-1];
} else {
$scoes->version = 'SCORM_1.2';
@@ -1003,33 +1003,51 @@ function scorm_get_manifest($blocks,$scoes) {
case 'TITLE':
$parent = array_pop($parents);
array_push($parents, $parent);
+ if (!isset($block['tagData'])) {
+ $block['tagData'] = '';
+ }
$scoes->elements[$manifest][$parent->organization][$parent->identifier]->title = addslashes($block['tagData']);
break;
case 'ADLCP:PREREQUISITES':
if ($block['attrs']['TYPE'] == 'aicc_script') {
$parent = array_pop($parents);
array_push($parents, $parent);
+ if (!isset($block['tagData'])) {
+ $block['tagData'] = '';
+ }
$scoes->elements[$manifest][$parent->organization][$parent->identifier]->prerequisites = addslashes($block['tagData']);
}
break;
case 'ADLCP:MAXTIMEALLOWED':
$parent = array_pop($parents);
array_push($parents, $parent);
+ if (!isset($block['tagData'])) {
+ $block['tagData'] = '';
+ }
$scoes->elements[$manifest][$parent->organization][$parent->identifier]->maxtimeallowed = addslashes($block['tagData']);
break;
case 'ADLCP:TIMELIMITACTION':
$parent = array_pop($parents);
array_push($parents, $parent);
+ if (!isset($block['tagData'])) {
+ $block['tagData'] = '';
+ }
$scoes->elements[$manifest][$parent->organization][$parent->identifier]->timelimitaction = addslashes($block['tagData']);
break;
case 'ADLCP:DATAFROMLMS':
$parent = array_pop($parents);
array_push($parents, $parent);
+ if (!isset($block['tagData'])) {
+ $block['tagData'] = '';
+ }
$scoes->elements[$manifest][$parent->organization][$parent->identifier]->datafromlms = addslashes($block['tagData']);
break;
case 'ADLCP:MASTERYSCORE':
$parent = array_pop($parents);
array_push($parents, $parent);
+ if (!isset($block['tagData'])) {
+ $block['tagData'] = '';
+ }
$scoes->elements[$manifest][$parent->organization][$parent->identifier]->masteryscore = addslashes($block['tagData']);
break;
}

0 comments on commit d74b879

Please sign in to comment.