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

SCORM: Regex dots are wrongly escaped in data model 1.2

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.10.3
    • None
    • SCORM
    • 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.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            dpalou Dani Palou
            Dan Marsden, Matteo Scaramuccia, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: