From b31c79a71f37bcbe221033e1e664d5feb17e0a42 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 8 Feb 2009 20:01:15 +0000 Subject: Fix a bug that I think I introduced in my last sendmail refactor where I inverted the expectations on the result from mail() causing image uploads to fail (even though the mail gets sent!) --- core/libraries/Sendmail.php | 2 +- core/tests/Sendmail_Test.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/libraries/Sendmail.php b/core/libraries/Sendmail.php index 88b74255..a1092734 100644 --- a/core/libraries/Sendmail.php +++ b/core/libraries/Sendmail.php @@ -83,7 +83,7 @@ class Sendmail_Core { // need to use a single \n. This can be set in config/sendmail.php $headers = implode($this->header_separator, $headers); $message = wordwrap($this->message, $this->line_length, "\n"); - if ($this->mail($to, $this->subject, $message, $headers)) { + if (!$this->mail($to, $this->subject, $message, $headers)) { Kohana::log("error", wordwrap("Sending mail failed:\nTo: $to\n $this->subject\n" . "Headers: $headers\n $this->message")); throw new Exception("@todo SEND MAIL FAILED"); diff --git a/core/tests/Sendmail_Test.php b/core/tests/Sendmail_Test.php index 4e813b16..777fea55 100644 --- a/core/tests/Sendmail_Test.php +++ b/core/tests/Sendmail_Test.php @@ -110,5 +110,6 @@ class Sendmail_For_Test extends Sendmail { public function mail($to, $subject, $message, $headers) { $this->send_text = "To: $to\r\n{$headers}\r\nSubject: $this->subject\r\n\r\n$message"; + return true; } } \ No newline at end of file -- cgit v1.2.3