Skip to content

Commit adb0197

Browse files
committed
Merge in changes from Google code 5.2.4 release
Code cleanup in SMTP class
1 parent a51a9e1 commit adb0197

9 files changed

+286
-275
lines changed

changelog.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
# ChangeLog
2-
3-
* Add CRAM-MD5 authentication, thanks to Elijah madden, https://github.com/okonomiyaki3000
4-
* Replacement of obsolete Quoted-Printable encoder with a much better implementation
5-
* Composer package definition
2+
3+
* Merge in changes from Google code 5.2.4 release
4+
* Minor coding standards cleanup in SMTP class
5+
* Improved unit tests, now tests S/MIME signing
6+
* Travis-CI support on GitHub, runs tests with fake SMTP server
7+
8+
## Version 5.2.4 (February 19, 2013)
9+
* Fix tag and version bug.
10+
* un-deprecate isSMTP(), isMail(), IsSendmail() and
11+
isQmail().
12+
* Numerous translation updates
13+
14+
## Version 5.2.3 (February 8, 2013)
15+
* Fix issue with older PCREs and ValidateAddress() (Bugz: 124)
16+
17+
* Add CRAM-MD5 authentication, thanks to Elijah madden, https://github.com/okonomiyaki3000
18+
* Replacement of obsolete Quoted-Printable encoder with a much better implementation
19+
* Composer package definition
20+
* New language added: Hebrew
621

722
## Version 5.2.2 (December 3, 2012)
823

class.phpmailer.php

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*~ class.phpmailer.php
33
.---------------------------------------------------------------------------.
44
| Software: PHPMailer - PHP email class |
5-
| Version: 5.2.2 |
5+
| Version: 5.2.4 |
66
| Site: https://code.google.com/a/apache-extras.org/p/phpmailer/ |
77
| ------------------------------------------------------------------------- |
88
| Admin: Jim Jagielski (project admininistrator) |
@@ -103,7 +103,7 @@ class PHPMailer {
103103
*/
104104
public $ReturnPath = '';
105105

106-
/**
106+
/**
107107
* Sets the Subject of the message.
108108
* @var string
109109
*/
@@ -390,7 +390,7 @@ class PHPMailer {
390390
* Sets the PHPMailer Version number
391391
* @var string
392392
*/
393-
public $Version = '5.2.2';
393+
public $Version = '5.2.4';
394394

395395
/**
396396
* What to use in the X-Mailer header
@@ -554,7 +554,6 @@ public function IsHTML($ishtml = true) {
554554
/**
555555
* Sets Mailer to send message using SMTP.
556556
* @return void
557-
* @deprecated
558557
*/
559558
public function IsSMTP() {
560559
$this->Mailer = 'smtp';
@@ -563,7 +562,6 @@ public function IsSMTP() {
563562
/**
564563
* Sets Mailer to send message using PHP mail() function.
565564
* @return void
566-
* @deprecated
567565
*/
568566
public function IsMail() {
569567
$this->Mailer = 'mail';
@@ -572,7 +570,6 @@ public function IsMail() {
572570
/**
573571
* Sets Mailer to send message using the $Sendmail program.
574572
* @return void
575-
* @deprecated
576573
*/
577574
public function IsSendmail() {
578575
if (!stristr(ini_get('sendmail_path'), 'sendmail')) {
@@ -584,7 +581,6 @@ public function IsSendmail() {
584581
/**
585582
* Sets Mailer to send message using the qmail MTA.
586583
* @return void
587-
* @deprecated
588584
*/
589585
public function IsQmail() {
590586
if (stristr(ini_get('sendmail_path'), 'qmail')) {
@@ -736,7 +732,7 @@ public function SetFrom($address, $name = '', $auto = 1) {
736732
*/
737733
public static function ValidateAddress($address) {
738734
if (defined('PCRE_VERSION')) { //Check this instead of extension_loaded so it works when that function is disabled
739-
if (PCRE_VERSION >= 8.0) {
735+
if (version_compare(PCRE_VERSION, '8.0') >= 0) {
740736
return (boolean)preg_match('/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', $address);
741737
} else {
742738
//Fall back to an older regex that doesn't need a recent PCRE
@@ -910,14 +906,14 @@ protected function SendmailSend($header, $body) {
910906
return true;
911907
}
912908

913-
/**
914-
* Sends mail using the PHP mail() function.
915-
* @param string $header The message headers
916-
* @param string $body The message body
917-
* @throws phpmailerException
918-
* @access protected
919-
* @return bool
920-
*/
909+
/**
910+
* Sends mail using the PHP mail() function.
911+
* @param string $header The message headers
912+
* @param string $body The message body
913+
* @throws phpmailerException
914+
* @access protected
915+
* @return bool
916+
*/
921917
protected function MailSend($header, $body) {
922918
$toArr = array();
923919
foreach($this->to as $t) {
@@ -2031,13 +2027,13 @@ public function Base64EncodeWrapMB($str, $lf=null) {
20312027
}
20322028

20332029
/**
2034-
* Encode string to RFC2045 (6.7) quoted-printable format
2035-
* @access public
2036-
* @param string $string The text to encode
2037-
* @param integer $line_max Number of chars allowed on a line before wrapping
2038-
* @return string
2039-
* @link PHP version adapted from http://www.php.net/manual/en/function.quoted-printable-decode.php#89417
2040-
*/
2030+
* Encode string to RFC2045 (6.7) quoted-printable format
2031+
* @access public
2032+
* @param string $string The text to encode
2033+
* @param integer $line_max Number of chars allowed on a line before wrapping
2034+
* @return string
2035+
* @link PHP version adapted from http://www.php.net/manual/en/function.quoted-printable-decode.php#89417
2036+
*/
20412037
public function EncodeQP($string, $line_max = 76) {
20422038
if (function_exists('quoted_printable_encode')) { //Use native function if it's available (>= PHP5.3)
20432039
return quoted_printable_encode($string);
@@ -2048,15 +2044,15 @@ public function EncodeQP($string, $line_max = 76) {
20482044
return $string;
20492045
}
20502046

2051-
/**
2052-
* Wrapper to preserve BC for old QP encoding function that was removed
2053-
* @see EncodeQP()
2054-
* @access public
2055-
* @param string $string
2056-
* @param integer $line_max
2057-
* @param bool $space_conv
2058-
* @return string
2059-
*/
2047+
/**
2048+
* Wrapper to preserve BC for old QP encoding function that was removed
2049+
* @see EncodeQP()
2050+
* @access public
2051+
* @param string $string
2052+
* @param integer $line_max
2053+
* @param bool $space_conv
2054+
* @return string
2055+
*/
20602056
public function EncodeQPphp($string, $line_max = 76, $space_conv = false) {
20612057
return $this->EncodeQP($string, $line_max);
20622058
}
@@ -2179,12 +2175,12 @@ public function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64',
21792175
* @param string $type MIME type.
21802176
* @return bool True on successfully adding an attachment
21812177
*/
2182-
public function AddStringEmbeddedImage($string, $cid, $filename = '', $encoding = 'base64', $type = 'application/octet-stream') {
2178+
public function AddStringEmbeddedImage($string, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
21832179
// Append to $attachment array
21842180
$this->attachment[] = array(
21852181
0 => $string,
2186-
1 => $filename,
2187-
2 => basename($filename),
2182+
1 => $name,
2183+
2 => $name,
21882184
3 => $encoding,
21892185
4 => $type,
21902186
5 => true, // isStringAttachment

class.pop3.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*~ class.pop3.php
33
.---------------------------------------------------------------------------.
44
| Software: PHPMailer - PHP email class |
5-
| Version: 5.2.2 |
5+
| Version: 5.2.4 |
66
| Site: https://code.google.com/a/apache-extras.org/p/phpmailer/ |
77
| ------------------------------------------------------------------------- |
88
| Admin: Jim Jagielski (project admininistrator) |
@@ -37,7 +37,7 @@
3737
/**
3838
* PHP POP-Before-SMTP Authentication Class
3939
*
40-
* Version 5.2.2
40+
* Version 5.2.4
4141
*
4242
* @license: LGPL, see PHPMailer License
4343
*
@@ -115,7 +115,7 @@ class POP3 {
115115
* Sets the POP3 PHPMailer Version number
116116
* @var string
117117
*/
118-
public $Version = '5.2.2';
118+
public $Version = '5.2.4';
119119

120120
/////////////////////////////////////////////////
121121
// PROPERTIES, PRIVATE AND PROTECTED

0 commit comments

Comments
 (0)