svn: /pear/packages/Mail_Mime/trunk/ mimePart.php

From: Date: Tue, 29 Dec 2009 11:08:28 +0000
Subject: svn: /pear/packages/Mail_Mime/trunk/ mimePart.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-58401@lists.php.net to get a copy of this message
alec Tue, 29 Dec 2009 11:08:28 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=292738 Log: - wrapped some very long lines Changed paths: U pear/packages/Mail_Mime/trunk/mimePart.php Modified: pear/packages/Mail_Mime/trunk/mimePart.php =================================================================== --- pear/packages/Mail_Mime/trunk/mimePart.php 2009-12-29 11:00:23 UTC (rev 292737) +++ pear/packages/Mail_Mime/trunk/mimePart.php 2009-12-29 11:08:28 UTC (rev 292738) @@ -123,7 +123,8 @@ * @param string $body The body of the mime part if any. * @param array $params An associative array of parameters: * content_type - The content type for this part eg multipart/mixed - * encoding - The encoding to use, 7bit, 8bit, base64, or quoted-printable + * encoding - The encoding to use, 7bit, 8bit, + * base64, or quoted-printable * cid - Content ID to apply * disposition - Content disposition, inline or attachment * dfilename - Optional filename parameter for content disposition @@ -250,20 +251,22 @@ if (count($this->_subparts)) { $boundary = '=_' . md5(rand() . microtime()); - $this->_headers['Content-Type'] .= ';' . MAIL_MIMEPART_CRLF . ' boundary="' . $boundary . '"'; + $crlf = MAIL_MIMEPART_CRLF; + $this->_headers['Content-Type'] .= ";$crlf boundary=\"$boundary\""; + $encoded['body'] = ''; for ($i = 0; $i < count($this->_subparts); $i++) { - $encoded['body'] .= '--' . $boundary . MAIL_MIMEPART_CRLF; + $encoded['body'] .= '--' . $boundary . $crlf; $tmp = $this->_subparts[$i]->encode(); foreach ($tmp['headers'] as $key => $value) { - $encoded['body'] .= $key . ': ' . $value . MAIL_MIMEPART_CRLF; + $encoded['body'] .= $key . ': ' . $value . $crlf; } - $encoded['body'] .= MAIL_MIMEPART_CRLF . $tmp['body'] . MAIL_MIMEPART_CRLF; + $encoded['body'] .= $crlf . $tmp['body'] . $crlf; } - $encoded['body'] .= '--' . $boundary . '--' . MAIL_MIMEPART_CRLF; + $encoded['body'] .= '--' . $boundary . '--' . $crlf; } else { $encoded['body'] = $this->_getEncodedData($this->_body, $this->_encoding); @@ -420,7 +423,9 @@ && (!$charset || strtolower($charset) == 'us-ascii') // charset && (!$language || preg_match('/^(en|en-us)$/i', $language)) // language ) { - if (!preg_match('#([^\x21,\x23-\x27,\x2A,\x2B,\x2D,\x2E,\x30-\x39,\x41-\x5A,\x5E-\x7E])#', $value)) { + $token_regexp = '#([^\x21,\x23-\x27,\x2A,\x2B,\x2D' + . ',\x2E,\x30-\x39,\x41-\x5A,\x5E-\x7E])#'; + if (!preg_match($token_regexp, $value)) { // token if (strlen($name) + strlen($value) + 3 <= $maxLength) { return " {$name}={$value}";

« previous php.pear.cvs (#58401) next »