Permalink
Browse files

MDL-17832 - consistent adding and removing of slashes for track data.…

… backport 1.8.
  • Loading branch information...
piers
piers committed Feb 4, 2009
1 parent 40ab2ed commit d104b078a4cb694a5ec98bc4a26937f137dd8d59
Showing with 2 additions and 2 deletions.
  1. +2 −2 mod/scorm/locallib.php
View
@@ -256,7 +256,7 @@ function scorm_get_scoes($id,$organisation=false) {
function scorm_insert_track($userid,$scormid,$scoid,$attempt,$element,$value) {
$id = null;
if ($track = get_record_select('scorm_scoes_track',"userid='$userid' AND scormid='$scormid' AND scoid='$scoid' AND attempt='$attempt' AND element='$element'")) {
- $track->value = $value;
+ $track->value = addslashes($value);
$track->timemodified = time();
$id = update_record('scorm_scoes_track',$track);
} else {
@@ -296,7 +296,7 @@ function scorm_get_tracks($scoid,$userid,$attempt='') {
$usertrack->timemodified = 0;
foreach ($tracks as $track) {
$element = $track->element;
- $usertrack->{$element} = $track->value;
+ $usertrack->{$element} = stripslashes_safe($track->value);
switch ($element) {
case 'cmi.core.lesson_status':
case 'cmi.completion_status':

0 comments on commit d104b07

Please sign in to comment.