ClearFoundation Tracker - ClearOS
View Issue Details
0022701ClearOSapp-events - Events Systempublic2019-01-08 14:102021-11-10 08:43
NickH 
NickH 
normalminoralways
closedfixed 
7.6.0 Updates 
7.6.0 Updates7.5.0 Updates 
0022701: Using multiple notification e-mails addresses gives an invalid e-mail address message
If you set up the Events with multiple addresses in the "Email to Notify" field you get an invalid e-mail address error.

I believe it is because the explode function in /usr/clearos/apps/events/libraries/Events.php is leaving a trailing space in the e-mail field. If you trim the "$email" parameter before testing, for validity then it works, so change line 1027 from:

if (!preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", $email))

to:

if (!preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", trim($email)))


No tags attached.
Issue History
2019-01-08 14:10NickHNew Issue
2019-01-08 14:12NickHDescription Updatedbug_revision_view_page.php?rev_id=2461#r2461
2019-01-09 07:53NickHNote Added: 0008731
2019-01-15 03:21NickHDescription Updatedbug_revision_view_page.php?rev_id=2521#r2521
2019-01-15 03:36NickHAssigned To => NickH
2019-01-15 03:36NickHStatusnew => assigned
2019-01-15 03:37NickHNote Added: 0008751
2019-02-01 12:27NickHStatusassigned => resolved
2019-02-01 12:27NickHFixed in Version => 7.5.0 Updates
2019-02-01 12:27NickHResolutionopen => fixed
2021-11-10 08:43NickHStatusresolved => closed

Notes
(0008731)
NickH   
2019-01-09 07:53   
Note the same problem exists when the system tries to send the e-mail. To fix, change line 842 of /usr/clearos/apps/events/libraries/Events.php to read:
$mailer->add_recipient(trim($email));
(0008751)
NickH   
2019-01-15 03:37   
Fixed in commit https://gitlab.com/clearos/clearfoundation/app-events/commit/61af3c6ea74e876bfc9f29d559a8dd1cf6454056 [^]