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:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón, Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

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