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

email_to_user does not check for an empty recipient address

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.9.2
    • 1.9.5
    • Libraries
    • None
    • Any
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

    Description

      Moodle will attempt to send email to a user even if their email address is null. This violates RFC821 and can generate a lot of error messages for administrators.

      It seems a straightforward fix would be to change the first conditional in email_to_user() in lib/moodlelib.php from:

      if (empty($user))

      { return false; }

      to:

      if (empty($user) || empty($user->email)) { return false; }

      Attachments

        Activity

          People

            poltawski Dan Poltawski
            meinzerj Jason Meinzer
            Petr Skoda Petr Skoda
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              13/May/09