diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-02-08 20:01:15 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-02-08 20:01:15 +0000 |
commit | b31c79a71f37bcbe221033e1e664d5feb17e0a42 (patch) | |
tree | 4e4a5cfe0898c27f13b045eb0c4b5118b042d978 | |
parent | 0f13f126386d7b1a01fc86ce6888de067b1fd21d (diff) |
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!)
-rw-r--r-- | core/libraries/Sendmail.php | 2 | ||||
-rw-r--r-- | core/tests/Sendmail_Test.php | 1 |
2 files changed, 2 insertions, 1 deletions
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 |