Changeset 776 for trunk


Ignore:
Timestamp:
Nov 1, 2022 1:35:37 AM (18 months ago)
Author:
anonymous
Message:

Improve notice of missing angle brackets with email addresses

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Email.inc.php

    r774 r776  
    406406        // Final “to” header can have multiple addresses if in an array.
    407407        $final_to = is_array($this->_params['to']) ? join(', ', $this->_params['to']) : $this->_params['to'];
    408         if (!preg_match('/(?:>$|>,)/', $final_to)) {
     408        if (preg_match('/[^,] /', $final_to) && !preg_match('/(?:>$|>,)/', $final_to)) {
     409            // If recipient address contains spaces, assume it contains a display name, in which case the email address should be in <br@ckets.com>.
    409410            $app->logMsg(sprintf('Email addresses should be enclosed in <angle brackets>: %s', $final_to), LOG_NOTICE, __FILE__, __LINE__);
    410411        }
Note: See TracChangeset for help on using the changeset viewer.