Reedy has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394513 )
Change subject: Update pear/mail_mime from v1.10.1 to v1.10.2 ...................................................................... Update pear/mail_mime from v1.10.1 to v1.10.2 https://github.com/pear/Mail_Mime/releases/tag/1.10.2 https://github.com/pear/Mail_Mime/compare/1.10.1...1.10.2 Change-Id: Ib9df08fefa21fb90804852aa73b8ef1e22e4dabc --- M composer.json M composer.lock M composer/include_paths.php M composer/installed.json M pear/mail_mime/Mail/mime.php M pear/mail_mime/Mail/mimePart.php M pear/mail_mime/package.xml A pear/mail_mime/tests/test_Bug_21255.phpt 8 files changed, 129 insertions(+), 96 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vendor refs/changes/13/394513/1 diff --git a/composer.json b/composer.json index 0a7f405..087e52f 100644 --- a/composer.json +++ b/composer.json @@ -87,7 +87,7 @@ "oyejorge/less.php": "1.7.0.14", "pear/console_getopt": "1.4.1", "pear/mail": "1.4.1", - "pear/mail_mime": "1.10.1", + "pear/mail_mime": "1.10.2", "pear/mail_mime-decode": "1.5.5.2", "pear/net_smtp": "1.7.3", "pear/net_socket": "1.2.1", diff --git a/composer.lock b/composer.lock index ad4345b..dbad8e6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "e948033dcea38ac3c205abf7e2e274f7", + "content-hash": "75dfcdd9f65a99995bfd9302c0096caf", "packages": [ { "name": "composer/semver", @@ -1491,16 +1491,16 @@ }, { "name": "pear/mail_mime", - "version": "1.10.1", + "version": "1.10.2", "source": { "type": "git", "url": "https://github.com/pear/Mail_Mime.git", - "reference": "3d4e33a6879cbb4c71684a282750b7bb072a121e" + "reference": "7b2f93fa5219da99e9997f497b916b5bb27eb57a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/Mail_Mime/zipball/3d4e33a6879cbb4c71684a282750b7bb072a121e", - "reference": "3d4e33a6879cbb4c71684a282750b7bb072a121e", + "url": "https://api.github.com/repos/pear/Mail_Mime/zipball/7b2f93fa5219da99e9997f497b916b5bb27eb57a", + "reference": "7b2f93fa5219da99e9997f497b916b5bb27eb57a", "shasum": "" }, "require": { @@ -1533,7 +1533,7 @@ ], "description": "Mail_Mime provides classes to create MIME messages", "homepage": "http://pear.php.net/package/Mail_Mime", - "time": "2017-05-21T10:43:06+00:00" + "time": "2017-11-17T09:21:45+00:00" }, { "name": "pear/mail_mime-decode", diff --git a/composer/include_paths.php b/composer/include_paths.php index 206c5c0..54a1ead 100644 --- a/composer/include_paths.php +++ b/composer/include_paths.php @@ -12,6 +12,6 @@ $vendorDir . '/pear/net_smtp', $vendorDir . '/pear/pear-core-minimal/src', $vendorDir . '/pear/mail', - $vendorDir . '/pear/mail_mime', $vendorDir . '/pear/net_socket', + $vendorDir . '/pear/mail_mime', ); diff --git a/composer/installed.json b/composer/installed.json index c031f43..beea8ad 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -1895,54 +1895,6 @@ "homepage": "http://pear.php.net/package/Mail" }, { - "name": "pear/mail_mime", - "version": "1.10.1", - "version_normalized": "1.10.1.0", - "source": { - "type": "git", - "url": "https://github.com/pear/Mail_Mime.git", - "reference": "3d4e33a6879cbb4c71684a282750b7bb072a121e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pear/Mail_Mime/zipball/3d4e33a6879cbb4c71684a282750b7bb072a121e", - "reference": "3d4e33a6879cbb4c71684a282750b7bb072a121e", - "shasum": "" - }, - "require": { - "pear/pear-core-minimal": "*" - }, - "time": "2017-05-21T10:43:06+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Mail": "./" - } - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "./" - ], - "license": [ - "BSD-3-clause" - ], - "authors": [ - { - "name": "Cipriano Groenendal", - "email": "ci...@php.net", - "role": "Lead" - }, - { - "name": "Aleksander Machniak", - "email": "a...@php.net", - "role": "Lead" - } - ], - "description": "Mail_Mime provides classes to create MIME messages", - "homepage": "http://pear.php.net/package/Mail_Mime" - }, - { "name": "pear/net_socket", "version": "v1.2.1", "version_normalized": "1.2.1.0", @@ -3834,5 +3786,53 @@ ], "description": "Provides library of common widgets, layouts, and windows.", "homepage": "https://www.mediawiki.org/wiki/OOjs_UI" + }, + { + "name": "pear/mail_mime", + "version": "1.10.2", + "version_normalized": "1.10.2.0", + "source": { + "type": "git", + "url": "https://github.com/pear/Mail_Mime.git", + "reference": "7b2f93fa5219da99e9997f497b916b5bb27eb57a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Mail_Mime/zipball/7b2f93fa5219da99e9997f497b916b5bb27eb57a", + "reference": "7b2f93fa5219da99e9997f497b916b5bb27eb57a", + "shasum": "" + }, + "require": { + "pear/pear-core-minimal": "*" + }, + "time": "2017-11-17T09:21:45+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Mail": "./" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-3-clause" + ], + "authors": [ + { + "name": "Cipriano Groenendal", + "email": "ci...@php.net", + "role": "Lead" + }, + { + "name": "Aleksander Machniak", + "email": "a...@php.net", + "role": "Lead" + } + ], + "description": "Mail_Mime provides classes to create MIME messages", + "homepage": "http://pear.php.net/package/Mail_Mime" } ] diff --git a/pear/mail_mime/Mail/mime.php b/pear/mail_mime/Mail/mime.php index dc5306a..f96a390 100644 --- a/pear/mail_mime/Mail/mime.php +++ b/pear/mail_mime/Mail/mime.php @@ -8,7 +8,7 @@ * contain plain-text bodies, HTML bodies, attachments, inline * images and specific headers. * - * Compatible with PHP >= 5 + * Compatible with PHP version 5 and 7 * * LICENSE: This LICENSE is in the BSD license style. * Copyright (c) 2002-2003, Richard Heyes <rich...@phpguru.org> @@ -104,14 +104,14 @@ protected $calbody; /** - * list of the attached images + * List of the attached images * * @var array */ protected $html_images = array(); /** - * list of the attachements + * List of the attachements * * @var array */ @@ -181,9 +181,7 @@ // Update build parameters if (!empty($params) && is_array($params)) { - while (list($key, $value) = each($params)) { - $this->build_params[$key] = $value; - } + $this->build_params = array_merge($this->build_params, $params); } } @@ -194,7 +192,7 @@ * @param string $value Parameter value * * @return void - * @since 1.6.0 + * @since 1.6.0 */ public function setParam($name, $value) { @@ -207,7 +205,7 @@ * @param string $name Parameter name * * @return mixed Parameter value - * @since 1.6.0 + * @since 1.6.0 */ public function getParam($name) { @@ -238,7 +236,7 @@ * Get message text body * * @return string Text body - * @since 1.6.0 + * @since 1.6.0 */ public function getTXTBody() { @@ -263,7 +261,7 @@ * Get message HTML body * * @return string HTML body - * @since 1.6.0 + * @since 1.6.0 */ public function getHTMLBody() { @@ -284,7 +282,7 @@ * @param string $encoding Transfer encoding * * @return mixed True on success or PEAR_Error object - * @since 1.9.0 + * @since 1.9.0 */ public function setCalendarBody($data, $isfile = false, $append = false, $method = 'request', $charset = 'UTF-8', $encoding = 'quoted-printable' @@ -302,7 +300,7 @@ * Get body of calendar part * * @return string Calendar part body - * @since 1.9.0 + * @since 1.9.0 */ public function getCalendarBody() { @@ -467,7 +465,7 @@ * Checks if the current message has many parts * * @return bool True if the message has many parts, False otherwise. - * @since 1.9.0 + * @since 1.9.0 */ public function isMultipart() { @@ -742,7 +740,7 @@ * get() method. See get() for more info. * * @return mixed The e-mail body or PEAR error object - * @since 1.6.0 + * @since 1.6.0 */ public function getMessageBody($params = null) { @@ -761,7 +759,7 @@ * @param bool $overwrite Overwrite the existing headers with new. * * @return mixed True or PEAR error object - * @since 1.6.0 + * @since 1.6.0 */ public function saveMessage($filename, $params = null, $headers = null, $overwrite = false) { @@ -806,7 +804,7 @@ * get() method. See get() for more info. * * @return mixed True or PEAR error object - * @since 1.6.0 + * @since 1.6.0 */ public function saveMessageBody($filename, $params = null) { @@ -857,10 +855,8 @@ */ public function get($params = null, $filename = null, $skip_head = false) { - if (isset($params)) { - while (list($key, $value) = each($params)) { - $this->build_params[$key] = $value; - } + if (!empty($params) && is_array($params)) { + $this->build_params = array_merge($this->build_params, $params); } if (isset($this->headers['From'])) { @@ -1161,25 +1157,22 @@ * @param array $params Hash array of header parameters * * @return void - * @since 1.7.0 + * @since 1.7.0 */ public function setContentType($type, $params = array()) { $header = $type; - $eol = !empty($this->build_params['eol']) - ? $this->build_params['eol'] : "\r\n"; + $eol = !empty($this->build_params['eol']) ? $this->build_params['eol'] : "\r\n"; // add parameters - $token_regexp = '#([^\x21\x23-\x27\x2A\x2B\x2D' - . '\x2E\x30-\x39\x41-\x5A\x5E-\x7E])#'; + $token_regexp = '#([^\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7E])#'; if (is_array($params)) { foreach ($params as $name => $value) { if ($name == 'boundary') { $this->build_params['boundary'] = $value; - } - if (!preg_match($token_regexp, $value)) { + } else if (!preg_match($token_regexp, $value)) { $header .= ";$eol $name=$value"; } else { $value = addcslashes($value, '\\"'); @@ -1340,7 +1333,7 @@ * @param string $encoding Encoding name (base64 or quoted-printable) * * @return string Encoded header data (without a name) - * @since 1.5.3 + * @since 1.5.3 */ public function encodeHeader($name, $value, $charset, $encoding) { @@ -1446,8 +1439,7 @@ } $headers['Content-Transfer-Encoding'] = $this->build_params['html_encoding']; - } - else if ($headers['Content-Type'] == 'text/calendar') { + } else if ($headers['Content-Type'] == 'text/calendar') { // single-part message: add charset and encoding if ($this->build_params['calendar_charset']) { $charset = 'charset=' . $this->build_params['calendar_charset']; diff --git a/pear/mail_mime/Mail/mimePart.php b/pear/mail_mime/Mail/mimePart.php index fff8860..47e546b 100644 --- a/pear/mail_mime/Mail/mimePart.php +++ b/pear/mail_mime/Mail/mimePart.php @@ -8,7 +8,7 @@ * of mime mail. * This class however allows full control over the email. * - * Compatible with PHP version 5 + * Compatible with PHP version 5 and 7 * * LICENSE: This LICENSE is in the BSD license style. * Copyright (c) 2002-2003, Richard Heyes <rich...@phpguru.org> @@ -93,7 +93,7 @@ * * @var array */ - protected $subparts; + protected $subparts = array(); /** * The output of this part after being built @@ -107,7 +107,7 @@ * * @var array */ - protected $headers; + protected $headers = array(); /** * The body of this part (not encoded) @@ -622,7 +622,7 @@ $escape = '='; $output = ''; - while (list($idx, $line) = each($lines)) { + foreach ($lines as $idx => $line) { $newline = ''; $i = 0; @@ -656,13 +656,17 @@ $output .= $newline . $escape . $eol; $newline = ''; } + $newline .= $char; } // end of for + $output .= $newline . $eol; unset($lines[$idx]); } + // Don't want last crlf $output = substr($output, 0, -1 * strlen($eol)); + return $output; } diff --git a/pear/mail_mime/package.xml b/pear/mail_mime/package.xml index f7e2ca2..908274a 100644 --- a/pear/mail_mime/package.xml +++ b/pear/mail_mime/package.xml @@ -26,10 +26,10 @@ <email>a...@php.net</email> <active>yes</active> </lead> - <date>2017-05-21</date> - <time>12:00:00</time> + <date>2017-11-17</date> + <time>11:00:00</time> <version> - <release>1.10.1</release> + <release>1.10.2</release> <api>1.10.0</api> </version> <stability> @@ -38,9 +38,8 @@ </stability> <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD Style</license> <notes> -* Fix Bug 21206: explodeQuotedString() does not handle quoted strings correctly [dfukagaw28] -* Fix Bug 21205: Invalid encoding of headers with quoted multibyte strings in non-unicode charset [dfukagaw28] -* Fix Bug 21098: Discrepancy in handling of empty (but set) plain text part [alec] +* Fix Bug #21255: Boundary gets added twice when using setContentType() [alec] +* PHP 7.2 compatibility fixes [alec] </notes> <contents> <dir name="/"> @@ -90,6 +89,7 @@ <file baseinstalldir="Mail" name="test_Bug_21098.phpt" role="test" /> <file baseinstalldir="Mail" name="test_Bug_21205.phpt" role="test" /> <file baseinstalldir="Mail" name="test_Bug_21206.phpt" role="test" /> + <file baseinstalldir="Mail" name="test_Bug_21255.phpt" role="test" /> </dir> <!-- /tests --> <dir name="Mail"> <file baseinstalldir="/" name="mime.php" role="php" /> @@ -843,5 +843,23 @@ * Add possibility to set preamble text for multipart messages [alec] </notes> </release> + <release> + <date>2017-05-21</date> + <time>12:00:00</time> + <version> + <release>1.10.1</release> + <api>1.10.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD Style</license> + <notes> +* Fix Bug 21206: explodeQuotedString() does not handle quoted strings correctly [dfukagaw28] +* Fix Bug 21205: Invalid encoding of headers with quoted multibyte strings in non-unicode charset [dfukagaw28] +* Fix Bug 21098: Discrepancy in handling of empty (but set) plain text part [alec] + </notes> + </release> </changelog> </package> diff --git a/pear/mail_mime/tests/test_Bug_21255.phpt b/pear/mail_mime/tests/test_Bug_21255.phpt new file mode 100644 index 0000000..778c621 --- /dev/null +++ b/pear/mail_mime/tests/test_Bug_21255.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #21255 Boundary gets added twice +--SKIPIF-- +--FILE-- +<?php +include "Mail/mime.php"; + +$mime = new Mail_mime("\r\n"); +$mime->setHTMLBody('html'); +$mime->setTXTBody('text'); +$mime->setContentType('multipart/alternative', array('boundary' => 'something')); + +$msg = $mime->getMessage(); + +echo substr_count($msg, 'boundary='); + +?> +--EXPECT-- +1 -- To view, visit https://gerrit.wikimedia.org/r/394513 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib9df08fefa21fb90804852aa73b8ef1e22e4dabc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vendor Gerrit-Branch: master Gerrit-Owner: Reedy <re...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits