Skip to content

Conversation

@mzk
Copy link
Contributor

@mzk 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.

@dg
Copy link
Member

dg commented Jul 3, 2018

IMHO function_exists('mail') should return false.

.travis.yml Outdated

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@milo fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

@mzk mzk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@dg dg closed this in 0f98357 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
dg pushed a commit that referenced this pull request Jul 16, 2018
@mzk mzk deleted the disable-function-mail branch July 16, 2018 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants