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

Mandatory fields accepting space as input

XMLWordPrintable

    • MySQL
    • MOODLE_19_STABLE, MOODLE_20_STABLE
    • MOODLE_20_STABLE, MOODLE_21_STABLE
    • wip-MDL-19907-master
    • Hide

      1. Add a Glossary activity to a course (or use any other form that has both text and editor fields required) and try to enter spaces or line breaks in the required fields. - You should be able to save it. Please note that TinyMCE suppresses the single space by itself, try entering several spaces and line breaks in the editor field.
      2. Go to Site Administration->Security->Site policies and set the checkbox "Strict validation of required fields"
      3. repeat step 1 - spaces are now not allowed
      4. Run tests in lib/simpletest/testformslib.php

      Show
      1. Add a Glossary activity to a course (or use any other form that has both text and editor fields required) and try to enter spaces or line breaks in the required fields. - You should be able to save it. Please note that TinyMCE suppresses the single space by itself, try entering several spaces and line breaks in the editor field. 2. Go to Site Administration->Security->Site policies and set the checkbox "Strict validation of required fields" 3. repeat step 1 - spaces are now not allowed 4. Run tests in lib/simpletest/testformslib.php

      In many of places in where moodle specifies a field ( input text field ) as mandatory, it is accepting "space" as a input and then proceeds without prompting,which results in an anonymous elements into the site or a course

      Steps to reproduce:

      Scenario 1:
      1. create a new course with space as course "full name" and with other details filled.

      Scenario 2 :
      1.Create a new user with some username and password with space as first name and lastname and city

      Actual Results :

      it is accepting "space" as a input and then proceeds without prompting,which results in an anonymous elements into the site or a course.

      Expected results :

      Space should be trimmed if its at the starting of any name or mandatory field, and if its not followed by any other valid characters the usual error highlighting should be done requesting the user to give valid inputs

        1. Course_error.png
          60 kB
          Ravishankar Somasundaram
        2. User_create_error.png
          63 kB
          Ravishankar Somasundaram
        3. MDL-19907
          1 kB
          Mark Johnson
        4. MDL-19907_2.patch
          1 kB
          Mark Johnson
        5. testformslib.php
          4 kB
          Sam Hemelryk

            marina Marina Glancy
            raviepic3 Ravishankar Somasundaram (Inactive)
            Andrew Davis Andrew Davis
            Sam Hemelryk Sam Hemelryk
            Michael de Raadt Michael de Raadt
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.