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

SCORM convert php eval() to use EvalMath Class

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Won't Do
    • Major
    • None
    • 2.8.7, 2.9.1
    • SCORM
    • MOODLE_28_STABLE, MOODLE_29_STABLE

    Description

      The function scorm_eval_prerequisites() uses the evil PHP eval() function. We should convert that to using the evalMath() class already included in Moodle which performs a similar task without being "evil"

      the problematic code:
      return eval('return '.implode($stack).';');

      Most packages I have only have a single prereq item so $stack only contains a single item with the string ' true ' or ' false ' and in this case all that is really needed is:

      return $element;

      instead of that other crap.

      but... if there are multiple items $stack would contain something like this: (I don't have any packages to test this)

      Array
      (
      [0] => false
      [1] => true
      )
      (the code puts 2 spaces before and after each value in the array (' false ', ' true ')

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              danmarsden Dan Marsden
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.