From 9b13381b0a2c9f7f9b8296a66d0d0b68cc33f167 Mon Sep 17 00:00:00 2001 From: Markus Bauer Date: Tue, 17 Jan 2017 19:42:57 +0100 Subject: [PATCH] Fix error messages if PHP's mail() function fails --- lib/Cake/Network/Email/MailTransport.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Network/Email/MailTransport.php b/lib/Cake/Network/Email/MailTransport.php index 3b40f21c1..4471394e6 100644 --- a/lib/Cake/Network/Email/MailTransport.php +++ b/lib/Cake/Network/Email/MailTransport.php @@ -72,12 +72,12 @@ class MailTransport extends AbstractTransport { //@codingStandardsIgnoreStart if (!@mail($to, $subject, $message, $headers)) { $error = error_get_last(); - $msg = 'Could not send email: ' . isset($error['message']) ? $error['message'] : 'unknown'; + $msg = 'Could not send email: ' . (isset($error['message']) ? $error['message'] : 'unknown'); throw new SocketException($msg); } } elseif (!@mail($to, $subject, $message, $headers, $params)) { $error = error_get_last(); - $msg = 'Could not send email: ' . isset($error['message']) ? $error['message'] : 'unknown'; + $msg = 'Could not send email: ' . (isset($error['message']) ? $error['message'] : 'unknown'); //@codingStandardsIgnoreEnd throw new SocketException($msg); }