MDL-12614 - Bad regular expression matching was causing syntactically

invalid js when returning to previously attempted SCORM package.

merged from MOODLE_19_STABLE
This commit is contained in:
poltawski
2008-04-30 11:54:39 +00:00
parent 094a70b7a1
commit aa2b1ba10d
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -133,9 +133,9 @@ function SCORMapi1_2() {
$objectives = '';
foreach($userdata as $element => $value){
if (substr($element,0,14) == 'cmi.objectives') {
preg_match('/\.(\d+)\./',$element,$matches);
$element = preg_replace('/\.(\d+)\./',".\$1.",$element);
if ($matches[1] == $count) {
$element = preg_replace('/\.(\d+)\./', "_\$1.", $element);
preg_match('/_(\d+)\./', $element, $matches);
if (isset($matches[1]) && $matches[1] == $count) {
$count++;
$end = strpos($element,$matches[1])+strlen($matches[1]);
$subelement = substr($element,0,$end);
+3 -3
View File
@@ -166,9 +166,9 @@ function SCORMapi1_3() {
$objectives = '';
foreach($userdata as $element => $value){
if (substr($element,0,14) == 'cmi.objectives') {
preg_match('/\.(\d+)\./',$element,$matches);
$element = preg_replace('/\.(\d+)\./',".N\$1.",$element);
if ($matches[1] == $count) {
$element = preg_replace('/\.(\d+)\./', "_\$1.", $element);
preg_match('/_(\d+)\./', $element, $matches);
if (isset($matches[1]) && $matches[1] == $count) {
$count++;
$end = strpos($element,$matches[1])+strlen($matches[1]);
$subelement = substr($element,0,$end);