From 468218baba833e38985a38e80d36cdf4ff24717f Mon Sep 17 00:00:00 2001 From: Synchro Date: Tue, 5 Nov 2013 23:02:53 +0100 Subject: [PATCH] Changelog, comments, formatting --- changelog.md | 1 + class.phpmailer.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 2dc5e556..a6817129 100644 --- a/changelog.md +++ b/changelog.md @@ -12,6 +12,7 @@ * Minor docs update * Add Latvian translation (Thanks to @eddsstudio) * Add Belarusian translation (Thanks to @amaksymiuk) +* Make autoloader work better on older PHP versions ## Version 5.2.7 (September 12th 2013) * Add Ukranian translation from @Krezalis diff --git a/class.phpmailer.php b/class.phpmailer.php index a39ba4a8..916e69ab 100644 --- a/class.phpmailer.php +++ b/class.phpmailer.php @@ -571,7 +571,8 @@ class PHPMailer { $this->exceptions = ($exceptions == true); //Make sure our autoloader is loaded - if (version_compare(PHP_VERSION, '5.1.2', '>=') and !spl_autoload_functions() || !in_array('PHPMailerAutoload', spl_autoload_functions())) { + if (version_compare(PHP_VERSION, '5.1.2', '>=') and + !spl_autoload_functions() || !in_array('PHPMailerAutoload', spl_autoload_functions())) { require 'PHPMailerAutoload.php'; } } @@ -1866,6 +1867,7 @@ class PHPMailer if (!defined('PKCS7_TEXT')) { throw new phpmailerException($this->lang('signing') . ' OpenSSL extension missing.'); } + //TODO would be nice to use php://temp streams here, but need to wrap for PHP < 5.1 $file = tempnam(sys_get_temp_dir(), 'mail'); file_put_contents($file, $body); //TODO check this worked $signed = tempnam(sys_get_temp_dir(), 'signed'); @@ -3092,7 +3094,7 @@ class PHPMailer /** - * Set the private key file and password for S/MIME signing. + * Set the public and private key files and password for S/MIME signing. * @access public * @param string $cert_filename * @param string $key_filename