Skip to content
Browse files

MDL-12614 - Bad regular expression matching was causing syntactically

invalid js when returning to previously attempted SCORM package.

Credit to Peter Chamberlin of ljcreate.com
  • Loading branch information...
1 parent 0df6bef commit 77666b4acf26b292e709ed721344f86a8a130df6 poltawski committed Apr 28, 2008
Showing with 2 additions and 2 deletions.
  1. +2 −2 mod/scorm/datamodels/scorm_12.js.php
View
4 mod/scorm/datamodels/scorm_12.js.php
@@ -133,8 +133,8 @@ 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);
+ $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]);

0 comments on commit 77666b4

Please sign in to comment.
Something went wrong with that request. Please try again.