From f12b7567b7ec9d2817428258b8ec49f90940a139 Mon Sep 17 00:00:00 2001 From: Pavel Date: Mon, 17 Aug 2015 17:02:24 +0500 Subject: [PATCH 1/2] =?UTF-8?q?*=20The=20=E2=80=9CsendMail=E2=80=9D=20meth?= =?UTF-8?q?od=20was=20slightly=20changed=20to=20eliminate=20errors=20in=20?= =?UTF-8?q?PHP=205.4-5.6=20during=20headers=20validation:=20=20=20=20-=20A?= =?UTF-8?q?ll=20double=20=E2=80=9C\r\n=E2=80=9D=20and=20singe=20=E2=80=9C\?= =?UTF-8?q?r\n=E2=80=9D=20were=20replaced=20with=20single=20PHP=5FEOL.=20?= =?UTF-8?q?=20=20=20-=20Leading=20or=20trailing=20PHP=5FEOL's=20are=20now?= =?UTF-8?q?=20trimmed=20in=20email=20content.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/snippets/ddTools/modx.ddtools.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/snippets/ddTools/modx.ddtools.class.php b/assets/snippets/ddTools/modx.ddtools.class.php index 913dae9..544ee58 100644 --- a/assets/snippets/ddTools/modx.ddtools.class.php +++ b/assets/snippets/ddTools/modx.ddtools.class.php @@ -1047,14 +1047,14 @@ public static function sendMail($to, $text, $from = 'info@divandesign.biz', $sub //Конвертируем тему в base64 $subject = "=?UTF-8?B?".base64_encode($subject)."?="; //Заголовки сообщения - $headers = "From: $from\r\nMIME-Version: 1.0\r\n"; + $headers = "From: ".$from.PHP_EOL."MIME-Version: 1.0".PHP_EOL; //Разделитель блоков в сообщении $bound = 'bound'.md5(time()); - $multipart = "Content-Type: multipart/mixed; boundary = \"".$bound."\"\r\n\r\n--".$bound; + $multipart = "Content-Type: multipart/mixed; boundary = \"".$bound."\"".PHP_EOL."--".$bound.PHP_EOL; //Добавлеям текст в сообщения - $multipart .= "\r\nContent-Type: text/html; charset=UTF-8 \r\n\r\n".$text."\r\n\r\n--".$bound; + $multipart .= "Content-Type: text/html; charset=UTF-8 ".PHP_EOL.trim($text, PHP_EOL).PHP_EOL."--".$bound; if(!empty($fileInputName)){ $attachFiles = array(); @@ -1088,16 +1088,16 @@ public static function sendMail($to, $text, $from = 'info@divandesign.biz', $sub //Перебираем присоединяемые файлы if(!empty($attachFiles)){ foreach($attachFiles as $name => $value){ - $multipart .= "\r\n". - 'Content-Type: application/octet-stream; name = "=?UTF-8?B?'.base64_encode($name)."?=\"\r\n". - "Content-Transfer-Encoding: base64\r\n\r\n". - base64_encode($value)."\r\n\r\n--".$bound; + $multipart .= PHP_EOL. + 'Content-Type: application/octet-stream; name = "=?UTF-8?B?'.base64_encode($name)."?=\"".PHP_EOL. + "Content-Transfer-Encoding: base64".PHP_EOL. + base64_encode($value).PHP_EOL."--".$bound; } } } //Добавляем разделитель окончания сообщения - $headers .= $multipart."--\r\n"; + $headers .= $multipart."--".PHP_EOL; $result = array(); From 61449067a6ed0ed2edc0c5cebd7d310e56f339ee Mon Sep 17 00:00:00 2001 From: Pavel Date: Mon, 17 Aug 2015 17:24:32 +0500 Subject: [PATCH 2/2] Prerelease 0.13.1 --- assets/snippets/ddTools/modx.ddtools.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/snippets/ddTools/modx.ddtools.class.php b/assets/snippets/ddTools/modx.ddtools.class.php index 544ee58..a7ad47e 100644 --- a/assets/snippets/ddTools/modx.ddtools.class.php +++ b/assets/snippets/ddTools/modx.ddtools.class.php @@ -1,13 +1,13 @@