From 43626c6ca442a1ca20d4a1c7d903f98994e7f73e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Feb 2012 16:00:22 +0100 Subject: [PATCH] Change split to 76 chars --- htdocs/core/class/CMailFile.class.php | 11 ++++------- htdocs/core/class/smtps.class.php | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 8ab422c7e12..b5e86bf948b 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -30,10 +30,9 @@ */ /** - * \class CMailFile - * \brief Class to send emails (with attachments or not) - * \remarks Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to); - * \remarks $mailfile->sendfile(); + * Class to send emails (with attachments or not) + * Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to); + * $mailfile->sendfile(); */ class CMailFile { @@ -106,8 +105,6 @@ class CMailFile // We define end of line (RFC 822bis section 2.3) $this->eol="\r\n"; - //if (preg_match('/^win/i',PHP_OS)) $this->eol="\r\n"; - //if (preg_match('/^mac/i',PHP_OS)) $this->eol="\r"; // On defini mixed_boundary $this->mixed_boundary = dol_hash(uniqid("dolibarr1")); @@ -479,7 +476,7 @@ class CMailFile if (is_readable($newsourcefile)) { $contents = file_get_contents($newsourcefile); // Need PHP 4.3 - $encoded = chunk_split(base64_encode($contents), 68, $this->eol); + $encoded = chunk_split(base64_encode($contents), 76, $this->eol); // 76 max is defined into http://tools.ietf.org/html/rfc2047 return $encoded; } else diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index bc33c0d9020..19ad6d18fcc 100755 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -1293,7 +1293,7 @@ class SMTPs { if ( $strContent ) { - $strContent = rtrim(chunk_split(base64_encode($strContent), 76, "\r\n")); + $strContent = rtrim(chunk_split(base64_encode($strContent), 76, "\r\n")); // 76 max is defined into http://tools.ietf.org/html/rfc2047 $this->_msgContent['attachment'][$strFileName]['mimeType'] = $strMimeType; $this->_msgContent['attachment'][$strFileName]['fileName'] = $strFileName;