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

Disable function mail #52

Closed
wants to merge 6 commits into from
Closed

Disable function mail #52

wants to merge 6 commits into from

Conversation

@mzk
Copy link
Contributor

mzk commented Jul 3, 2018

  • bug fix
  • BC break? no

While is the function mail() disabled, the condition if ($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.

mzk added 2 commits Jul 3, 2018
@dg

This comment has been minimized.

Copy link
Member

dg commented Jul 3, 2018

IMHO function_exists('mail') should return false.

mzk added 3 commits Jul 3, 2018
.travis.yml Outdated
@@ -12,6 +12,7 @@ install:

script:
- vendor/bin/tester tests -s
- php -c tests/disable-mail.ini tests/Mail/SendmailMailer.phpt

This comment has been minimized.

Copy link
@milo

milo Jul 9, 2018

Member

No need to add another script. You may use @phpIni disable_function=mail annotation in test.

@@ -29,6 +29,9 @@ class SendmailMailer implements IMailer
*/
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.');

This comment has been minimized.

Copy link
@milo

milo Jul 9, 2018

Member

Personally, I would not print the reason. has been disabled. is IMHO enough.

This comment has been minimized.

Copy link
@mzk

mzk Jul 16, 2018

Author Contributor

@milo fixed.

This comment has been minimized.

Copy link
@mzk

mzk Jul 16, 2018

Author Contributor

https://github.com/mzk/mail/commits/disable-function-mail tady ten commit je, ale v pull requestu se neobjevil

Copy link
Contributor Author

mzk left a comment

updated

@dg dg closed this in 0f98357 Jul 16, 2018
dg added a commit that referenced this pull request Jul 16, 2018
dg added a commit that referenced this pull request Jul 16, 2018
dg added a commit that referenced this pull request Jul 16, 2018
@mzk mzk deleted the mzk:disable-function-mail branch Jul 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.