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

Incorrect <INPUT> sizes and maxlengths in the signup_form.html

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.3
    • Fix Version/s: 1.9
    • Component/s: Unknown
    • Labels:
      None
    • Environment:
      Reported at Linux, Apache, PostgreSQL 8.1
    • Database:
      PostgreSQL
    • Affected Branches:
      MOODLE_16_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      There are incorrect values of attributes size="" and missing attributes maxlegth="" in the login/signup_form.html

      Current values do not correspond with the database schema as they do in the user profile form. E.g. there is no maxlength="" limit in the CITY field. Thus a user may type longer city name. With PostgreSQL server this may cause an error during INSERT INTO mdl_user because the city is CHARACTER VARYING(20) only (as far as I know, MySQL trims these longer varchars to fit the field while PostgreSQL produces an error).

      I recommend following patch of login/signup_form.html:

      RCS file: /cvsroot/moodle/moodle/login/signup_form.html,v
      retrieving revision 1.10
      diff -r1.10 signup_form.html
      35c35
      < <td><input type="text" name="username" size="12" value="<?php p($user->username) ?>" alt="<?php print_string("username") ?>" />

      > <td><input type="text" name="username" size="12" maxlength="100" value="<?php p($user->username) ?>" alt="<?php print_string("username") ?>" />
      53c53
      < <td><input type="text" name="email" size="25" value="<?php p($user->email) ?>" alt="<?php print_string("email") ?>" />

      > <td><input type="text" name="email" size="25" maxlength="100" value="<?php p($user->email) ?>" alt="<?php print_string("email") ?>" />
      59c59
      < <td><input type="text" name="email2" size="25" value="<?php p($user->email2) ?>" alt="<?php print_string("emailagain") ?>" />

      > <td><input type="text" name="email2" size="25" maxlength="100" value="<?php p($user->email2) ?>" alt="<?php print_string("emailagain") ?>" />
      65c65
      < <td><input type="text" name="firstname" size="25" value="<?php p($user->firstname) ?>" alt="<?php print_string("firstname") ?>" />

      > <td><input type="text" name="firstname" size="20" maxlength="20" value="<?php p($user->firstname) ?>" alt="<?php print_string("firstname") ?>" />
      71c71
      < <td><input type="text" name="lastname" size="25" value="<?php p($user->lastname) ?>" alt="<?php print_string("lastname") ?>" />

      > <td><input type="text" name="lastname" size="20" maxlength="20" value="<?php p($user->lastname) ?>" alt="<?php print_string("lastname") ?>" />
      77c77
      < <td><input type="text" name="city" size="25" value="<?php p($user->city) ?>" alt="<?php print_string("city") ?>" />

      > <td><input type="text" name="city" size="20" maxlength="20" value="<?php p($user->city) ?>" alt="<?php print_string("city") ?>" />

        Attachments

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            mudrd8mz David Mudrák (@mudrd8mz)
            Tester:
            Nobody
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              3/Mar/08