From: Tim Düsterhus Date: Tue, 14 Jun 2016 21:22:25 +0000 (+0200) Subject: Check return value of mail() X-Git-Tag: 3.0.0_Beta_1~1443 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5b3c06237e1a0427ed64bd9ac9dd679673cde4fc;p=GitHub%2FWoltLab%2FWCF.git Check return value of mail() --- diff --git a/wcfsetup/install/files/lib/system/email/transport/PhpEmailTransport.class.php b/wcfsetup/install/files/lib/system/email/transport/PhpEmailTransport.class.php index 2f649ffd11..3f97c14313 100644 --- a/wcfsetup/install/files/lib/system/email/transport/PhpEmailTransport.class.php +++ b/wcfsetup/install/files/lib/system/email/transport/PhpEmailTransport.class.php @@ -1,5 +1,6 @@ getAddress(), $email->getSubject(), StringUtil::unifyNewlines($email->getBodyString()), $headers, '-f'.$email->getSender()->getAddress()); + $return = mail($envelopeTo->getAddress(), $email->getSubject(), StringUtil::unifyNewlines($email->getBodyString()), $headers, '-f'.$email->getSender()->getAddress()); } else { - mail($envelopeTo->getAddress(), $email->getSubject(), StringUtil::unifyNewlines($email->getBodyString()), $headers); + $return = mail($envelopeTo->getAddress(), $email->getSubject(), StringUtil::unifyNewlines($email->getBodyString()), $headers); + } + + if (!$return) { + throw new TransientFailure("mail() returned false"); } } }