Details
Description
Definitions like
CMIString200 = '^.{0,200}$';
reject followinf Unicode chars:
U+000A LINE FEED
U+000D CARRIAGE RETURN
U+2028 LINE SEPARATOR
U+2029 PARAGRAPH SEPARATOR
An attempt to call SetValue(param_name, str_value), where str_value contains any of these chars fails.
What is the reason for such restriction?
Attachments
Issue Links
| This issue has been marked as being related by: | ||||
| MDL-8193 | Incorrect handling of quotes in SetValue processing |
|
|
|
I guess the main problem is in following code from SetValue:
eval(element+'="'value'";');
which can not work for value containing quotes enters, etc. I am no JS expert but IMHO it could be solved by:
element = element+String(value);
right?
In anycase if there are any quotes or newlines there is a new PHP function addslashes_js() in weblib.php that should be used whenever you construct javascript strings from PHP code
I am attaching patch for Scorm1.2 and 1.3 that with changes described above.