[wp-trac] [WordPress Trac] #50720: PHPMailer's validator defaults to 'php' after the upgrade

WordPress Trac noreply at wordpress.org
Tue Jul 21 11:55:34 UTC 2020


#50720: PHPMailer's validator defaults to 'php' after the upgrade
--------------------------+-----------------------------
 Reporter:  david.binda   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Mail          |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The old version of the PHPMailer was setting the validator to 'auto'
 resulting in a sophisticated logic for determining what email address
 validation should be used ( see
 https://core.trac.wordpress.org/browser/trunk/src/wp-includes/class-
 phpmailer.php?rev=47198#L1082 ).

 But the new version defaults to 'php', possibly leading to rejection of
 email addresses which were fine prior to the upgrade. For instance in
 environments with `PCRE_VERSION` constant defined (see
 https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/PHPMailer/PHPMailer.php?rev=48033#L576 ).

 IMHO, the way to accommodate the backward compatibility would be to set
 the static validator property to a value previously determined by the auto
 mode. Eg.: by introducing a new function mimicking the logic, and calling
 it from related code; whenever a new PHPMailer object is created as well
 as in the `wp-includes/class-phpmailer.php` file, which is very likely
 required in case a plugin is doing something with the PHPMailer class.

 But there might be some flaws I'm not seeing, or there might be a better
 approach.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50720>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list