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

            damyon Damyon Wiese
            damyon Damyon Wiese
            David Monllaó David Monllaó
            CiBoT CiBoT
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Sara Arjona (@sarjona), Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              14/Jan/19