Changeset 505f6e5 in github
- Timestamp:
- Jun 9, 2012 9:48:53 AM (12 months ago)
- Branches:
- release-0.8
- Children:
- 9e43252
- Parents:
- 16114e6
- git-author:
- Aleksander Machniak <alec@…> (06/09/12 09:44:56)
- git-committer:
- Aleksander Machniak <alec@…> (06/09/12 09:48:53)
- Files:
-
- 3 edited
-
CHANGELOG (modified) (1 diff)
-
program/lib/Mail/mime.php (modified) (7 diffs)
-
program/lib/Mail/mimePart.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
ra7d5e3e8 r505f6e5 2 2 =========================== 3 3 4 - Update to Mail_Mime-1.8.5 (#1488521) 4 5 - Fix XSS vulnerability in message subject handling using Larry skin (#1488519) 5 6 - Fix handling of links with various URI schemes e.g. "skype:" (#1488106) -
program/lib/Mail/mime.php
rfe3a1d6 r505f6e5 49 49 * @copyright 2003-2006 PEAR <pear-group@php.net> 50 50 * @license http://www.opensource.org/licenses/bsd-license.php BSD License 51 * @version CVS: $Id$51 * @version 1.8.5 52 52 * @link http://pear.php.net/package/Mail_mime 53 53 * … … 90 90 * @copyright 2003-2006 PEAR <pear-group@php.net> 91 91 * @license http://www.opensource.org/licenses/bsd-license.php BSD License 92 * @version Release: @package_version@92 * @version Release: 1.8.5 93 93 * @link http://pear.php.net/package/Mail_mime 94 94 */ … … 388 388 * @param string $h_charset The character set of the headers e.g. filename 389 389 * If not specified, $charset will be used 390 * @param array $add_headers Additional part headers. Array keys can be in form 391 * of <header_name>:<parameter_name> 390 392 * 391 393 * @return mixed True on success or PEAR_Error object … … 404 406 $f_encoding = null, 405 407 $description = '', 406 $h_charset = null 408 $h_charset = null, 409 $add_headers = array() 407 410 ) { 408 411 $bodyfile = null; … … 443 446 'disposition' => $disposition, 444 447 'description' => $description, 448 'add_headers' => $add_headers, 445 449 'name_encoding' => $n_encoding, 446 450 'filename_encoding' => $f_encoding, … … 680 684 if (!empty($value['description'])) { 681 685 $params['description'] = $value['description']; 686 } 687 if (is_array($value['add_headers'])) { 688 $params['headers'] = $value['add_headers']; 682 689 } 683 690 … … 1320 1327 function encodeHeader($name, $value, $charset, $encoding) 1321 1328 { 1322 return Mail_mimePart::encodeHeader( 1329 $mime_part = new Mail_mimePart; 1330 return $mime_part->encodeHeader( 1323 1331 $name, $value, $charset, $encoding, $this->_build_params['eol'] 1324 1332 ); -
program/lib/Mail/mimePart.php
re5b5162 r505f6e5 49 49 * @copyright 2003-2006 PEAR <pear-group@php.net> 50 50 * @license http://www.opensource.org/licenses/bsd-license.php BSD License 51 * @version CVS: $Id$51 * @version 1.8.5 52 52 * @link http://pear.php.net/package/Mail_mime 53 53 */ … … 71 71 * @copyright 2003-2006 PEAR <pear-group@php.net> 72 72 * @license http://www.opensource.org/licenses/bsd-license.php BSD License 73 * @version Release: @package_version@73 * @version Release: 1.8.5 74 74 * @link http://pear.php.net/package/Mail_mime 75 75 */ … … 157 157 * If not set, 'charset' will be used 158 158 * eol - End of line sequence. Default: "\r\n" 159 * headers - Hash array with additional part headers. Array keys can be 160 * in form of <header_name>:<parameter_name> 159 161 * body_file - Location of file with part's body (instead of $body) 160 162 * … … 167 169 } else if (defined('MAIL_MIMEPART_CRLF')) { // backward-copat. 168 170 $this->_eol = MAIL_MIMEPART_CRLF; 171 } 172 173 // Additional part headers 174 if (!empty($params['headers']) && is_array($params['headers'])) { 175 $headers = $params['headers']; 169 176 } 170 177 … … 217 224 } 218 225 } 226 227 // header values encoding parameters 228 $h_charset = !empty($params['headers_charset']) ? $params['headers_charset'] : 'US-ASCII'; 229 $h_language = !empty($params['language']) ? $params['language'] : null; 230 $h_encoding = !empty($params['name_encoding']) ? $params['name_encoding'] : null; 231 232 219 233 if (!empty($params['filename'])) { 220 234 $headers['Content-Type'] .= ';' . $this->_eol; 221 235 $headers['Content-Type'] .= $this->_buildHeaderParam( 222 'name', $params['filename'], 223 !empty($params['headers_charset']) ? $params['headers_charset'] : 'US-ASCII', 224 !empty($params['language']) ? $params['language'] : null, 225 !empty($params['name_encoding']) ? $params['name_encoding'] : null 236 'name', $params['filename'], $h_charset, $h_language, $h_encoding 226 237 ); 227 238 } … … 233 244 $headers['Content-Disposition'] .= ';' . $this->_eol; 234 245 $headers['Content-Disposition'] .= $this->_buildHeaderParam( 235 'filename', $params['filename'], 236 !empty($params['headers_charset']) ? $params['headers_charset'] : 'US-ASCII', 237 !empty($params['language']) ? $params['language'] : null, 246 'filename', $params['filename'], $h_charset, $h_language, 238 247 !empty($params['filename_encoding']) ? $params['filename_encoding'] : null 239 248 ); 240 249 } 250 251 // add attachment size 252 $size = $this->_body_file ? filesize($this->_body_file) : strlen($body); 253 if ($size) { 254 $headers['Content-Disposition'] .= ';' . $this->_eol . ' size=' . $size; 255 } 241 256 } 242 257 243 258 if (!empty($params['description'])) { 244 259 $headers['Content-Description'] = $this->encodeHeader( 245 'Content-Description', $params['description'], 246 !empty($params['headers_charset']) ? $params['headers_charset'] : 'US-ASCII', 247 !empty($params['name_encoding']) ? $params['name_encoding'] : 'quoted-printable', 260 'Content-Description', $params['description'], $h_charset, $h_encoding, 248 261 $this->_eol 249 262 ); 263 } 264 265 // Search and add existing headers' parameters 266 foreach ($headers as $key => $value) { 267 $items = explode(':', $key); 268 if (count($items) == 2) { 269 $header = $items[0]; 270 $param = $items[1]; 271 if (isset($headers[$header])) { 272 $headers[$header] .= ';' . $this->_eol; 273 } 274 $headers[$header] .= $this->_buildHeaderParam( 275 $param, $value, $h_charset, $h_language, $h_encoding 276 ); 277 unset($headers[$key]); 278 } 250 279 } 251 280
Note: See TracChangeset
for help on using the changeset viewer.
