Details
Description
When trying to set some string value containing quotes for such params like "cmi.interactions.n.learner_response", or
"cmi.comments_from_learner.n.comment" , "cmi.suspend_data", some strange behaviour is shown:
1. when string contains single quote (apostrophe) it gets unnecessary slashes before apostrophes stored in database
changing line 259 in mod/scorm/locallib.php as follows seems to fix it
$id = insert_record('scorm_scoes_track',$track, false);
original code just makes double quoting
2. when string contains double quote (") , this value can't be processed in JavaScript functions, calls to API just return npthing, and setted value is ignored, without even a failure result code. I suspect the reason is usage of eval in datamodels/scorm_1x.js.php, like that:
if (element == 'cmi.comments')
{ eval(element+'+="'+value+'";'); }else
{ eval(element+'="'+value+'";'); }
Attachments
Issue Links
- has a non-specific relationship to
-
MDL-8191 String datatypes defined in datamodels/scorm_13.js.php reject newlines
-
- Closed
-
-
MDL-6904 scorm package add problem in catalan i18n
-
- Closed
-
- has been marked as being related by
-
MDL-8935 Javascript strings not correctly scaped causes failure on some components
-
- Closed
-
- is duplicated by
-
MDL-11884 Line 511 of mod/scorm/API.PHP does not escape single quotes
-
- Closed
-
-
MDL-12857 eval() quote escaping
-
- Closed
-
-
MDL-15854 [PATCH] Use addslashes_js on firstname and lastname
-
- Closed
-