Incorporate file-reading changes from #500

Update changelog
This commit is contained in:
Marcus Bointon 2017-05-11 01:56:57 +02:00
parent c33a3a7824
commit d798b197ed
No known key found for this signature in database
GPG Key ID: DE31CD6EB646AA24
2 changed files with 8 additions and 1 deletions

View File

@ -46,9 +46,10 @@ This is a major update that breaks backwards compatibility.
* `Debugoutput` can accept a PSR-3 logger instance
* To reduce code footprint, the examples folder is no longer included in composer deployments or github zip files
* Trap low-level errors in SMTP, reports via debug output
* Handle bare codes (an RFC contravention) in SMTP server responses
* Make message timestamps more dynamic - calculate the date separately for each message
* More thorough checks for reading attachments.
* Throw an exception when trying to send a message with an empty body caused by an internal error.
## Version 5.2.23 (March 15th 2017)
* Improve trapping of TLS errors during connection so that they don't cause warnings, and are reported better in debug output

View File

@ -2415,6 +2415,9 @@ class PHPMailer
if ($this->isError()) {
$body = '';
if ($this->exceptions) {
throw new Exception($this->lang('empty_message'), self::STOP_CRITICAL);
}
} elseif ($this->sign_key_file) {
try {
if (!defined('PKCS7_TEXT')) {
@ -2767,6 +2770,9 @@ class PHPMailer
throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE);
}
$file_buffer = file_get_contents($path);
if (false === $file_buffer) {
throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE);
}
$file_buffer = $this->encodeString($file_buffer, $encoding);
return $file_buffer;
} catch (Exception $exc) {