Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/mail/15 deal better with spaces in from email address #12346

Merged
merged 2 commits into from
Jul 13, 2018

Conversation

michaelmcandrew
Copy link
Contributor

@civibot
Copy link

civibot bot commented Jun 20, 2018

(Standard links)

@michaelmcandrew michaelmcandrew changed the title ensure but do not assume that parts of from email addresses are seper… dev/mail/15 deal better with spaces in from email address Jun 20, 2018
@eileenmcnaughton
Copy link
Contributor

@michaelmcandrew a) thank you very much & b)regex changes are scary - can we spin the regex into it's own function & add a test that iterates through a few strings?

@seamuslee001
Copy link
Contributor

Also @michaelmcandrew should we go through the databases and run this in an upgrade as well?

@michaelmcandrew michaelmcandrew force-pushed the dev/mail/15 branch 2 times, most recently from eb332e9 to 2eb1a7d Compare June 26, 2018 15:17
@michaelmcandrew
Copy link
Contributor Author

@eileenmcnaughton - I've extracted it to a function and added a unit test.

@seamuslee001 - I don't think it is worth the risk of introducing a bug to the upgrade script since

  1. it is a real edge case that people have two spaces in their from email (and as eileen said, could be argued this is a misconfiguration)
  2. we are now santizing on input, and also correcting on output. the only time this would be an issue is if someone had already scheduled an email with a double space email address. they can fix it after upgrading by simply editing the email which will force the value to be recalculated. it will not affect any subsequent emails.

@eileenmcnaughton
Copy link
Contributor

@michaelmcandrew test fail relates

PHP Fatal error: Call to protected method CRM_Admin_Form_Options::sanitizeFromEmailAddress() from context 'CRM_Core_OptionGroupTest' in /home/jenkins/buildkit/build/core-12346-

@michaelmcandrew @seamuslee001 I agree that it is probably enough to fix going forwards. Probably anyone experiencing this error has already been hurt & self-fixed it. We could add a system check but I'm not convinced it's worth the effort. We could also do a str_replace double space for single when actually sending - it might still not be a priority to do that though

@eileenmcnaughton
Copy link
Contributor

@michaelmcandrew next rc gets cut on Wed - would be nice to get this merged since it seems stuck on something trivial

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@seamuslee001
Copy link
Contributor

Change seems fine to myself and Eileen adding merge on pass thanks @michaelmcandrew

@seamuslee001
Copy link
Contributor

Merging as per the tag

@seamuslee001 seamuslee001 merged commit a2b25ec into civicrm:master Jul 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants