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

Use require_param when possible

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Hub
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      $id = optional_param('id', 0, PARAM_INT);

      if (empty($id)) {
      throw new moodle_exception('wrongurlformat', 'hub');
      }

      why not require_param()?

      and MUST_EXIST somewhere later

      who is going to translate this?

      it is lots of extra work translating all these funny error messages that you see once in a lifetime

      thanks

        Attachments

          Activity

            People

            Assignee:
            jerome Jérôme Mouneyrac
            Reporter:
            jerome Jérôme Mouneyrac
            Tester:
            Nobody
            Participants:
            Component watchers:
            David Mudrák (@mudrd8mz), Helen Foster
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              24/Nov/10