Disable function mail#52
Closed
mzk wants to merge 6 commits intonette:masterfrom
mzk:disable-function-mail
Closed
Conversation
Member
|
IMHO |
milo
reviewed
Jul 9, 2018
.travis.yml
Outdated
|
|
||
| script: | ||
| - vendor/bin/tester tests -s | ||
| - php -c tests/disable-mail.ini tests/Mail/SendmailMailer.phpt |
Member
There was a problem hiding this comment.
No need to add another script. You may use @phpIni disable_function=mail annotation in test.
milo
reviewed
Jul 9, 2018
src/Mail/SendmailMailer.php
Outdated
| public function send(Message $mail): void | ||
| { | ||
| if (function_exists('mail') === false) { | ||
| throw new SendException('Unable to send email: mail() has been disabled for security reasons.'); |
Member
There was a problem hiding this comment.
Personally, I would not print the reason. has been disabled. is IMHO enough.
Contributor
Author
There was a problem hiding this comment.
https://github.com/mzk/mail/commits/disable-function-mail tady ten commit je, ale v pull requestu se neobjevil
dg
pushed a commit
that referenced
this pull request
Jul 16, 2018
dg
pushed a commit
that referenced
this pull request
Jul 16, 2018
dg
pushed a commit
that referenced
this pull request
Jul 16, 2018
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.
While is the function
mail()disabled, the conditionif ($res === false) {isn't catched.The code will pass silently, but the email is not sent.
I'm not sure, how to fix. (in nette/mail or in Nette/Utils). Thanks for help.