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

Do not allow leading/trailing whitespace in enrolment keys and other password fields

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      • Exercise this test on some places that use the passwordunmask form element - such as Self enrolment settings form, Quiz settings form, Group form etc.
      • TEST: Attempting to define a password with whitespace at the beginning or end should raise the form validation error and the form can't be saved unless the problem is fixed.
      • REGRESSION TEST: If the password value has been defined with a wrapping whitespace prior to applying this patch, students still must provide the password with the whitespace. But the form where the password is defined can't be re-saved unless the password is changed.
      Show
      Exercise this test on some places that use the passwordunmask form element - such as Self enrolment settings form, Quiz settings form, Group form etc. TEST: Attempting to define a password with whitespace at the beginning or end should raise the form validation error and the form can't be saved unless the problem is fixed. REGRESSION TEST: If the password value has been defined with a wrapping whitespace prior to applying this patch, students still must provide the password with the whitespace. But the form where the password is defined can't be re-saved unless the password is changed.
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_23_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-36056-master-enrolkeywhitespace

      Description

      Note: This was originally reported as "Trim enrolment key with php's trim()" but it evolved into a proposal to disallow leading/trailing whitespace in all passwordunmask elements.

      Hi, it happened to me for the second time now. Since I am administering some moodle courses, I have copied and pasted an enrolment key. Unfortunaltely I have copied some whitespaces, which led to the fact, that students could not login. The poor teacher, who got all the mails was quite rightly "disappointed"

      Anyway, a simple php trim(enrolment_key); could help the issue.

      Thanks
      Markus

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mudrd8mz David Mudrák (@mudrd8mz)
              Reporter:
              marknow22 Markus Nowatzki
              Peer reviewer:
              Luca Bösch
              Integrator:
              Damyon Wiese
              Tester:
              Mark Nelson
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              2 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                17/May/18