Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-71192

SCORM: Regex dots are wrongly escaped in data model 1.2

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.10.3
    • Fix Version/s: None
    • Component/s: SCORM
    • Labels:
      None
    • Affected Branches:
      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.

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            dpalou Dani Palou
            Participants:
            Component watchers:
            Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: