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

function validate_email is too strict

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6
    • Component/s: Authentication
    • Labels:
      None
    • Environment:
      All
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_15_STABLE
    • Fixed Branches:
      MOODLE_16_STABLE

      Description

      The function validate_email in lib/weblib.php doesn't validate emails of the form

      firstname.lastname@host.organization.com

      according to the function there may only be a country level domain and a top level domain, so only

      firstname.lastname@organization.com

      would be accepted, which is due to the regular expression:

      return (ereg('[-!#$%&\'*+
      ./0-9=?A-Z
      _`a-z

      {/}~]+'.

      '@'.

      '[-!#$%&\'*+
      /0-9=?A-Z^_`a-z{/}

      ~]+\.'.

      '[-!#$%&\'*+
      ./0-9=?A-Z^_`a-z

      {/}

      ~]+$',

      $address));

        Attachments

          Activity

            People

            • Assignee:
              poltawski Dan Poltawski
              Reporter:
              imported Imported
              Participants:
              Component watchers:
              Jake Dallimore, Jun Pataleta
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                20/Jun/06