Added "Reply to" field to mail header#8
Open
IQAndreas wants to merge 5 commits into
Open
Conversation
Owner
This seems uneccessary, but will mainly help avoid merge conflicts in future changes. - `$subject` is defined elsewhere (but immediately set to `$SUBJECT`) - `$msg` renamed to `$message`. I'm not poor; I can afford 4 extra characters - `$headers` is a separate variable rather than passed directly as a string
Currently only used in one place, but will be used more in the future.
The header is now properly cleaned to avoid at least one form of email injection (even in case the blog owner accidentally puts a bad email address in the `$EMAIL_ADDRESS` variable. Both functions taken from http://mattgeri.com/blog/2012/01/escaping-input-to-the-php-mail-function/ (should I include attribution in the code as well?)
This extra field will only be added if the user has supplied an email address. This fix allows blog owners to reply to the user's comment by replying to their email (if they included an email address in the comment) if they want a private reply rather than a reply as a comment on the blog.
Contributor
Author
|
Third version. Does this look better? I switched to a different cleaning function for mail input which seems to suit the purpose much better. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fix allows blog owners to reply to the user's comment by replying to their email (if they included an email address in the comment) if they want a private reply rather than a reply as a comment on the blog.
Second version. This time I use the recommended header cleaning function from http://stackoverflow.com/questions/8071916/escape-string-to-use-in-mail