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

Messaging external api functions don't validate their parameters

    XMLWordPrintable

    Details

      Description

      The validate_parameters calls in message/externallib.php are mostly not doing anything at all.

      validate_parameters returns the validated parameters with defaults applied. If you don't use the return from this function, you haven't done anything.

      This is repeated through most of message/externallib.php.

      example:

       

      self::validate_parameters(self::data_for_messagearea_messages_parameters(), $params);

       

      doesn't do anything at all.

       

       

      should be:

       

      $params = self::validate_parameters(self::data_for_messagearea_messages_parameters(), $params);

      after which you have to use the returned $params['name'] - not the arguments to the function.

       

       

        Attachments

          Activity

            People

            • Assignee:
              damyon Damyon Wiese
              Reporter:
              damyon Damyon Wiese
              Integrator:
              David Monllaó
              Tester:
              CiBoT
              Participants:
              Component watchers:
              Jake Dallimore, Jun Pataleta, Juan Leyva, Jake Dallimore, Jun Pataleta
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Jan/19