-
Notifications
You must be signed in to change notification settings - Fork 723
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
Hacktoberfest: trim fields to match mailer #221
Conversation
Trim fields to match similar changes that were made to mailer. Also matched descriptions to match mailer. Finally, I added the same form validator to defaultSuffix that exists in mailer. Signed-off-by: Darin Pope <darin@planetpope.com>
@@ -453,6 +454,13 @@ public void setDefaultContentType(String contentType) { | |||
} | |||
} | |||
|
|||
public FormValidation doCheckDefaultSuffix(@QueryParameter String value) { | |||
if (value.matches("@[A-Za-z0-9.\\-]+") || Util.fixEmptyAndTrim(value)==null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are underscores not allowed in the suffix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to RFC 1035 (...have as interior characters only letters, digits, and hyphen), underscores are not allowed.
This method was copied from mailer-plugin, so if it should be allowed, it probably should be done in both here and in mailer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the clarification. The PR looks great to me!
address = nullify(jo.optString("address", null)); | ||
smtpHost = nullify(jo.optString("smtpHost", null)); | ||
smtpPort = nullify(jo.optString("smtpPort", null)); | ||
address = Util.nullify(jo.optString("address", null)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This constructor is no longer used, it is there only for binary compatibility.
Trim fields to match similar changes that were made to mailer.
Also matched descriptions to match mailer.
Finally, I added the same form validator to defaultSuffix that exists in mailer.
Signed-off-by: Darin Pope darin@planetpope.com