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

WS validate_parameters() in execution methods, to be or not to be

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.7.5, 2.8.3, 2.9
    • Fix Version/s: None
    • Component/s: Web Services
    • Labels:
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE

      Description

      Till now it always have been required (and it's present as #1 in my WS review cheatsheet) to verify that validate_parameters() is present it the execution of the function and that, only validated params are used along the function body.

      But here, while reviewing a function fix eagle-eye David Monllaó realised that webservice_base_server->execute() method always perform a validate_parameters() call before invoking the function.

      So the question is... why have been always requiring the explicit validation since the born of the webservices when it's already performed automagically? Is there any case where that's not happening?

      Welcome, ciao

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              stronk7 Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: