Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
3.10.3
-
None
-
None
-
MOODLE_310_STABLE
Description
I've just noticed that some regular expressions in datamodel scorm_12.js escape dots with a single backslash, but in strings they need to be escaped with a double backslash. For example, in the CMIResults regex. This means that the API will accept some results that it shouldn't (e.g. the CMIResults regex will accept "1,2", "1+2", "1a2", etc.).
new RegExp('.') is the same as new RegExp('\.'). To escape that dot you need to do: new RegExp('\\.')
|
I've checked scorm_13.js and they're escaped with a double backslash in there.