diff -Nru libphp-swiftmailer-5.2.2/CHANGES libphp-swiftmailer-5.4.1/CHANGES --- libphp-swiftmailer-5.2.2/CHANGES 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/CHANGES 2015-06-06 14:19:39.000000000 +0000 @@ -1,6 +1,33 @@ Changelog ========= +5.4.1 (2015-06-06) +------------------ + + * made Swiftmailer exceptions confirm to PHP base exception constructor signature + * fixed MAIL FROM & RCPT TO headers to be RFC compliant + +5.4.0 (2015-03-14) +------------------ + + * added the possibility to add extra certs to PKCS#7 signature + * fix base64 encoding with streams + * added a new RESULT_SPOOLED status for SpoolTransport + * fixed getBody() on attachments when called more than once + * removed dots from generated filenames in filespool + +5.3.1 (2014-12-05) +------------------ + + * fixed cloning of messages with attachments + +5.3.0 (2014-10-04) +------------------ + + * fixed cloning when using signers + * reverted removal of Swift_Encoding + * drop support for PHP 5.2.x + 5.2.2 (2014-09-20) ------------------ diff -Nru libphp-swiftmailer-5.2.2/composer.json libphp-swiftmailer-5.4.1/composer.json --- libphp-swiftmailer-5.2.2/composer.json 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/composer.json 2015-06-06 14:19:39.000000000 +0000 @@ -2,7 +2,7 @@ "name": "swiftmailer/swiftmailer", "type": "library", "description": "Swiftmailer, free feature-rich PHP mailer", - "keywords": ["mail","mailer"], + "keywords": ["mail","mailer","email"], "homepage": "http://swiftmailer.org", "license": "MIT", "authors": [ @@ -15,17 +15,17 @@ } ], "require": { - "php": ">=5.2.4" + "php": ">=5.3.3" }, "require-dev": { - "mockery/mockery": "~0.9.1" + "mockery/mockery": "~0.9.1,<0.9.4" }, "autoload": { "files": ["lib/swift_required.php"] }, "extra": { "branch-alias": { - "dev-master": "5.2-dev" + "dev-master": "5.4-dev" } } } diff -Nru libphp-swiftmailer-5.2.2/debian/changelog libphp-swiftmailer-5.4.1/debian/changelog --- libphp-swiftmailer-5.2.2/debian/changelog 2014-09-23 18:40:16.000000000 +0000 +++ libphp-swiftmailer-5.4.1/debian/changelog 2015-07-08 14:26:57.000000000 +0000 @@ -1,3 +1,10 @@ +libphp-swiftmailer (5.4.1-1) unstable; urgency=medium + + * Imported Upstream version 5.4.1 + * Update Standards-Version (no changes needed) + + -- Jeremy T. Bouse Wed, 08 Jul 2015 10:26:53 -0400 + libphp-swiftmailer (5.2.2-1) unstable; urgency=medium * debian/gbp.conf: Update postbuild for git-buildpackage diff -Nru libphp-swiftmailer-5.2.2/debian/control libphp-swiftmailer-5.4.1/debian/control --- libphp-swiftmailer-5.2.2/debian/control 2014-08-25 17:32:11.000000000 +0000 +++ libphp-swiftmailer-5.4.1/debian/control 2015-07-08 14:22:12.000000000 +0000 @@ -5,7 +5,7 @@ Uploaders: Jeremy T. Bouse Build-Depends: debhelper (>> 9.0.0), pkg-php-tools (>= 1.7~) -Standards-Version: 3.9.5 +Standards-Version: 3.9.6 Homepage: http://swiftmailer.org/ Vcs-Git: git://github.com/jbouse-debian/php-swiftmailer.git Vcs-Browser: https://github.com/jbouse-debian/php-swiftmailer diff -Nru libphp-swiftmailer-5.2.2/doc/installing.rst libphp-swiftmailer-5.4.1/doc/installing.rst --- libphp-swiftmailer-5.2.2/doc/installing.rst 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/doc/installing.rst 2015-06-06 14:19:39.000000000 +0000 @@ -1,74 +1,15 @@ Installing the Library ====================== -Installing Swift Mailer is trivial. Usually it's just a case of uploading the -extracted source files to your web server. - Installing with Composer ------------------------ -If you use Composer to manage your project dependencies, you can install -Swiftmailer like this: +The recommended way to install Swiftmailer is via Composer: .. code-block:: bash $ php composer.phar require swiftmailer/swiftmailer @stable -Installing from a Package -------------------------- - -Most users will download a package from the Swift Mailer website and install -Swift Mailer using this. - -If you downloaded Swift Mailer as a ``.tar.gz`` or -``.zip`` file installation is as simple as extracting the archive -and uploading it to your web server. - -Extracting the Library -~~~~~~~~~~~~~~~~~~~~~~ - -You extract the archive by using your favorite unarchiving tool such as -``tar`` or 7-Zip. - -You will need to have access to a program that can open uncompress the -archive. On Windows computers, 7-Zip will work. On Mac and Linux systems you -can use ``tar`` on the command line. - -To extract your downloaded package: - -* Use the "extract" facility of your archiving software. - -The source code will be placed into a directory with the same name as the -archive (e.g. Swift-4.0.0-b1). - -The following example shows the process on Mac OS X and Linux systems using -the ``tar`` command. - -.. code-block:: bash - - $ ls - Swift-4.0.0-dev.tar.gz - $ tar xvzf Swift-4.0.0-dev.tar.gz - Swift-4.0.0-dev/ - Swift-4.0.0-dev/lib/ - Swift-4.0.0-dev/lib/classes/ - Swift-4.0.0-dev/lib/classes/Swift/ - Swift-4.0.0-dev/lib/classes/Swift/ByteStream/ - Swift-4.0.0-dev/lib/classes/Swift/CharacterReader/ - Swift-4.0.0-dev/lib/classes/Swift/CharacterReaderFactory/ - Swift-4.0.0-dev/lib/classes/Swift/CharacterStream/ - Swift-4.0.0-dev/lib/classes/Swift/Encoder/ - - ... etc etc ... - - Swift-4.0.0-dev/tests/unit/Swift/Transport/LoadBalancedTransportTest.php - Swift-4.0.0-dev/tests/unit/Swift/Transport/SendmailTransportTest.php - Swift-4.0.0-dev/tests/unit/Swift/Transport/StreamBufferTest.php - $ cd Swift-4.0.0-dev - $ ls - CHANGES LICENSE ... - $ - Installing from Git ------------------- @@ -123,75 +64,6 @@ CHANGES LICENSE ... $ -Installing from PEAR --------------------- - -.. note:: - - Using PEAR for installing Swiftmailer is deprecated and Swiftmailer 5.1.0 - was the last version published on the PEAR channel; use Composer instead. - -If you want to install Swift Mailer globally on your machine, the easiest -installation method is using the PEAR channel. - -To install the Swift Mailer PEAR package: - -* Run the command ``pear channel-discover pear.swiftmailer.org``. - -* Then, run the command ``pear install swift/swift``. - -Uploading to your Host ----------------------- - -You only need to upload the "lib/" directory to your web host for production -use. All other files and directories are support files not needed in -production. - -You will need FTP, ``rsync`` or similar software installed in order to upload -the "lib/" directory to your web host. - -To upload Swift Mailer: - -* Open your FTP program, or a command line if you prefer rsync/scp. - -* Upload the "lib/" directory to your hosting account. - -The files needed to use Swift Mailer should now be accessible to PHP on your -host. - -The following example shows show you can upload the files using -``rsync`` on Linux or OS X. - -.. note:: - - You do not need to place the files inside your web root. They only need to - be in a place where your PHP scripts can "include" them. - - .. code-block:: bash - - $ rsync -rvz lib d11wtq@swiftmailer.org:swiftmailer - building file list ... done - created directory swiftmailer - lib/ - lib/mime_types.php - lib/preferences.php - lib/swift_required.php - lib/classes/ - lib/classes/Swift/ - lib/classes/Swift/Attachment.php - lib/classes/Swift/CharacterReader.php - ... etc etc ... - lib/dependency_maps/ - lib/dependency_maps/cache_deps.php - lib/dependency_maps/mime_deps.php - lib/dependency_maps/transport_deps.php - - sent 151692 bytes received 2974 bytes 5836.45 bytes/sec - total size is 401405 speedup is 2.60 - $ - -.. _`GitHub`: http://github.com/swiftmailer/swiftmailer - Troubleshooting --------------- @@ -213,3 +85,5 @@ { mb_internal_encoding($mbEncoding); } + +.. _`GitHub`: http://github.com/swiftmailer/swiftmailer diff -Nru libphp-swiftmailer-5.2.2/doc/sending.rst libphp-swiftmailer-5.4.1/doc/sending.rst --- libphp-swiftmailer-5.2.2/doc/sending.rst 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/doc/sending.rst 2015-06-06 14:19:39.000000000 +0000 @@ -368,7 +368,7 @@ .. note:: The ``mail()`` function can take a ``$additional_parameters`` parameter. - Swift Mailer sets this to "``-f%s``" by default, where the "%s" is + Swift Mailer sets this to "``-f%s``" by default, where the "``%s``" is substituted with the address of the sender (via a ``sprintf()``) at send time. You may override this default by passing an argument to ``newInstance()``. diff -Nru libphp-swiftmailer-5.2.2/.gitattributes libphp-swiftmailer-5.4.1/.gitattributes --- libphp-swiftmailer-5.2.2/.gitattributes 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/.gitattributes 2015-06-06 14:19:39.000000000 +0000 @@ -4,3 +4,6 @@ *.pub -crlf *.priv -crlf *.txt -crlf + +# ignore /notes in the git-generated distributed .zip archive +/notes export-ignore diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Attachment.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Attachment.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Attachment.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Attachment.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Attachment class for attaching files to a {@link Swift_Mime_Message}. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Attachment extends Swift_Mime_Attachment { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php libphp-swiftmailer-5.4.1/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Provides the base functionality for an InputStream supporting filters. * - * @author Chris Corbyn + * @author Chris Corbyn */ abstract class Swift_ByteStream_AbstractFilterableInputStream implements Swift_InputByteStream, Swift_Filterable { @@ -75,9 +75,9 @@ * * @param string $bytes * - * @return int - * * @throws Swift_IoException + * + * @return int */ public function write($bytes) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/ByteStream/ArrayByteStream.php libphp-swiftmailer-5.4.1/lib/classes/Swift/ByteStream/ArrayByteStream.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/ByteStream/ArrayByteStream.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/ByteStream/ArrayByteStream.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Allows reading and writing of bytes to and from an array. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_ByteStream_ArrayByteStream implements Swift_InputByteStream, Swift_OutputByteStream { @@ -23,7 +23,7 @@ private $_array = array(); /** - * The size of the stack + * The size of the stack. * * @var int */ @@ -70,7 +70,7 @@ * remaining bytes are given instead. If no bytes are remaining at all, boolean * false is returned. * - * @param int $length + * @param int $length * * @return string */ @@ -82,7 +82,7 @@ // Don't use array slice $end = $length + $this->_offset; - $end = $this->_arraySize<$end + $end = $this->_arraySize < $end ? $this->_arraySize : $end; $ret = ''; @@ -152,7 +152,7 @@ /** * Move the internal read pointer to $byteOffset in the stream. * - * @param int $byteOffset + * @param int $byteOffset * * @return bool */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/ByteStream/FileByteStream.php libphp-swiftmailer-5.4.1/lib/classes/Swift/ByteStream/FileByteStream.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/ByteStream/FileByteStream.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/ByteStream/FileByteStream.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Allows reading and writing of bytes to and from a file. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_ByteStream_FileByteStream extends Swift_ByteStream_AbstractFilterableInputStream implements Swift_FileStream { @@ -39,8 +39,8 @@ /** * Create a new FileByteStream for $path. * - * @param string $path - * @param bool $writable if true + * @param string $path + * @param bool $writable if true */ public function __construct($path, $writable = false) { @@ -73,11 +73,11 @@ * remaining bytes are given instead. If no bytes are remaining at all, boolean * false is returned. * - * @param int $length - * - * @return string|bool + * @param int $length * * @throws Swift_IoException + * + * @return string|bool */ public function read($length) { @@ -111,7 +111,7 @@ /** * Move the internal read pointer to $byteOffset in the stream. * - * @param int $byteOffset + * @param int $byteOffset * * @return bool */ @@ -191,8 +191,8 @@ } if ($this->_seekable === false) { $currentPos = ftell($this->_reader); - if ($currentPos<$offset) { - $toDiscard = $offset-$currentPos; + if ($currentPos < $offset) { + $toDiscard = $offset - $currentPos; fread($this->_reader, $toDiscard); return; diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/ByteStream/TemporaryFileByteStream.php libphp-swiftmailer-5.4.1/lib/classes/Swift/ByteStream/TemporaryFileByteStream.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/ByteStream/TemporaryFileByteStream.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/ByteStream/TemporaryFileByteStream.php 2015-06-06 14:19:39.000000000 +0000 @@ -9,7 +9,7 @@ */ /** - * @author Romain-Geissler + * @author Romain-Geissler */ class Swift_ByteStream_TemporaryFileByteStream extends Swift_ByteStream_FileByteStream { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,8 +11,8 @@ /** * Provides fixed-width byte sizes for reading fixed-width character sets. * - * @author Chris Corbyn - * @author Xavier De Cock + * @author Chris Corbyn + * @author Xavier De Cock */ class Swift_CharacterReader_GenericFixedWidthReader implements Swift_CharacterReader { @@ -26,7 +26,7 @@ /** * Creates a new GenericFixedWidthReader using $width bytes per character. * - * @param int $width + * @param int $width */ public function __construct($width) { @@ -36,10 +36,10 @@ /** * Returns the complete character map. * - * @param string $string - * @param int $startOffset - * @param array $currentMap - * @param mixed $ignoredChars + * @param string $string + * @param int $startOffset + * @param array $currentMap + * @param mixed $ignoredChars * * @return int */ @@ -48,7 +48,7 @@ $strlen = strlen($string); // % and / are CPU intensive, so, maybe find a better way $ignored = $strlen % $this->_width; - $ignoredChars = substr($string, - $ignored); + $ignoredChars = substr($string, -$ignored); $currentMap = $this->_width; return ($strlen - $ignored) / $this->_width; @@ -73,8 +73,8 @@ * A value of zero means this is already a valid character. * A value of -1 means this cannot possibly be a valid character. * - * @param string $bytes - * @param int $size + * @param string $bytes + * @param int $size * * @return int */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterReader/UsAsciiReader.php libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterReader/UsAsciiReader.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterReader/UsAsciiReader.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterReader/UsAsciiReader.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,17 +11,17 @@ /** * Analyzes US-ASCII characters. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_CharacterReader_UsAsciiReader implements Swift_CharacterReader { /** * Returns the complete character map. * - * @param string $string - * @param int $startOffset - * @param array $currentMap - * @param string $ignoredChars + * @param string $string + * @param int $startOffset + * @param array $currentMap + * @param string $ignoredChars * * @return int */ @@ -30,9 +30,9 @@ $strlen = strlen($string); $ignoredChars = ''; for ($i = 0; $i < $strlen; ++$i) { - if ($string[$i]>"\x07F") { + if ($string[$i] > "\x07F") { // Invalid char - $currentMap[$i+$startOffset] = $string[$i]; + $currentMap[$i + $startOffset] = $string[$i]; } } @@ -40,9 +40,9 @@ } /** - * Returns mapType + * Returns mapType. * - * @return int mapType + * @return int mapType */ public function getMapType() { @@ -57,8 +57,8 @@ * A value of zero means this is already a valid character. * A value of -1 means this cannot possibly be a valid character. * - * @param string $bytes - * @param int $size + * @param string $bytes + * @param int $size * * @return int */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterReader/Utf8Reader.php libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterReader/Utf8Reader.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterReader/Utf8Reader.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterReader/Utf8Reader.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,8 +11,8 @@ /** * Analyzes UTF-8 characters. * - * @author Chris Corbyn - * @author Xavier De Cock + * @author Chris Corbyn + * @author Xavier De Cock */ class Swift_CharacterReader_Utf8Reader implements Swift_CharacterReader { @@ -75,16 +75,16 @@ /** * Returns the complete character map. * - * @param string $string - * @param int $startOffset - * @param array $currentMap - * @param mixed $ignoredChars + * @param string $string + * @param int $startOffset + * @param array $currentMap + * @param mixed $ignoredChars * * @return int */ public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars) { - if (!isset($currentMap['i']) || ! isset($currentMap['p'])) { + if (!isset($currentMap['i']) || !isset($currentMap['p'])) { $currentMap['p'] = $currentMap['i'] = array(); } @@ -134,7 +134,7 @@ /** * Returns mapType. * - * @return int mapType + * @return int mapType */ public function getMapType() { @@ -149,14 +149,14 @@ * A value of zero means this is already a valid character. * A value of -1 means this cannot possibly be a valid character. * - * @param string $bytes - * @param int $size + * @param string $bytes + * @param int $size * * @return int */ public function validateByteSequence($bytes, $size) { - if ($size<1) { + if ($size < 1) { return -1; } $needed = self::$length_map[$bytes[0]] - $size; diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Standard factory for creating CharacterReaders. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactory implements Swift_CharacterReaderFactory { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterReaderFactory.php libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterReaderFactory.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterReaderFactory.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterReaderFactory.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A factory for creating CharacterReaders. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_CharacterReaderFactory { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterReader.php libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterReader.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterReader.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterReader.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,8 +11,8 @@ /** * Analyzes characters for a specific character set. * - * @author Chris Corbyn - * @author Xavier De Cock + * @author Chris Corbyn + * @author Xavier De Cock */ interface Swift_CharacterReader { @@ -21,12 +21,12 @@ const MAP_TYPE_POSITIONS = 0x03; /** - * Returns the complete character map + * Returns the complete character map. * - * @param string $string - * @param int $startOffset - * @param array $currentMap - * @param mixed $ignoredChars + * @param string $string + * @param int $startOffset + * @param array $currentMap + * @param mixed $ignoredChars * * @return int */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterStream/ArrayCharacterStream.php libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterStream/ArrayCharacterStream.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterStream/ArrayCharacterStream.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterStream/ArrayCharacterStream.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A CharacterStream implementation which stores characters in an internal array. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_CharacterStream_ArrayCharacterStream implements Swift_CharacterStream { @@ -121,7 +121,7 @@ * Read $length characters from the stream and move the internal pointer * $length further into the stream. * - * @param int $length + * @param int $length * * @return string */ @@ -153,7 +153,7 @@ * Read $length characters from the stream and return a 1-dimensional array * containing there octet values. * - * @param int $length + * @param int $length * * @return integer[] */ @@ -244,7 +244,7 @@ /** * Move the internal pointer to $charOffset in the stream. * - * @param int $charOffset + * @param int $charOffset */ public function setPointer($charOffset) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterStream/NgCharacterStream.php libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterStream/NgCharacterStream.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterStream/NgCharacterStream.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterStream/NgCharacterStream.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,9 +11,8 @@ /** * A CharacterStream implementation which stores characters in an internal array. * - * @author Xavier De Cock + * @author Xavier De Cock */ - class Swift_CharacterStream_NgCharacterStream implements Swift_CharacterStream { /** @@ -45,7 +44,7 @@ private $_datas = ''; /** - * Number of bytes in the stream + * Number of bytes in the stream. * * @var int */ @@ -156,7 +155,7 @@ /** * @see Swift_CharacterStream::read() * - * @param int $length + * @param int $length * * @return string */ @@ -166,12 +165,12 @@ return false; } $ret = false; - $length = ($this->_currentPos+$length > $this->_charCount) + $length = ($this->_currentPos + $length > $this->_charCount) ? $this->_charCount - $this->_currentPos : $length; switch ($this->_mapType) { case Swift_CharacterReader::MAP_TYPE_FIXED_LEN: - $len = $length*$this->_map; + $len = $length * $this->_map; $ret = substr($this->_datas, $this->_currentPos * $this->_map, $len); @@ -185,7 +184,7 @@ : $end; $ret = ''; for (; $this->_currentPos < $length; ++$this->_currentPos) { - if (isset ($this->_map[$this->_currentPos])) { + if (isset($this->_map[$this->_currentPos])) { $ret .= '?'; } else { $ret .= $this->_datas[$this->_currentPos]; @@ -200,8 +199,8 @@ : $end; $ret = ''; $start = 0; - if ($this->_currentPos>0) { - $start = $this->_map['p'][$this->_currentPos-1]; + if ($this->_currentPos > 0) { + $start = $this->_map['p'][$this->_currentPos - 1]; } $to = $start; for (; $this->_currentPos < $end; ++$this->_currentPos) { @@ -222,7 +221,7 @@ /** * @see Swift_CharacterStream::readBytes() * - * @param int $length + * @param int $length * * @return integer[] */ @@ -241,11 +240,11 @@ /** * @see Swift_CharacterStream::setPointer() * - * @param int $charOffset + * @param int $charOffset */ public function setPointer($charOffset) { - if ($this->_charCount<$charOffset) { + if ($this->_charCount < $charOffset) { $charOffset = $this->_charCount; } $this->_currentPos = $charOffset; @@ -268,7 +267,7 @@ $this->_datas .= $chars; $this->_charCount += $this->_charReader->getCharPositions(substr($this->_datas, $this->_datasSize), $this->_datasSize, $this->_map, $ignored); if ($ignored !== false) { - $this->_datasSize = strlen($this->_datas)-strlen($ignored); + $this->_datasSize = strlen($this->_datas) - strlen($ignored); } else { $this->_datasSize = strlen($this->_datas); } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterStream.php libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterStream.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/CharacterStream.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/CharacterStream.php 2015-06-06 14:19:39.000000000 +0000 @@ -15,7 +15,7 @@ * Classes implementing this interface may use a subsystem which requires less * memory than working with large strings of data. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_CharacterStream { @@ -52,7 +52,7 @@ * Read $length characters from the stream and move the internal pointer * $length further into the stream. * - * @param int $length + * @param int $length * * @return string */ @@ -62,7 +62,7 @@ * Read $length characters from the stream and return a 1-dimensional array * containing there octet values. * - * @param int $length + * @param int $length * * @return int[] */ @@ -78,7 +78,7 @@ /** * Move the internal pointer to $charOffset in the stream. * - * @param int $charOffset + * @param int $charOffset */ public function setPointer($charOffset); diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/ConfigurableSpool.php libphp-swiftmailer-5.4.1/lib/classes/Swift/ConfigurableSpool.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/ConfigurableSpool.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/ConfigurableSpool.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Base class for Spools (implements time and message limits). * - * @author Fabien Potencier + * @author Fabien Potencier */ abstract class Swift_ConfigurableSpool implements Swift_Spool { @@ -24,7 +24,7 @@ /** * Sets the maximum number of messages to send per flush. * - * @param int $limit + * @param int $limit */ public function setMessageLimit($limit) { @@ -34,7 +34,7 @@ /** * Gets the maximum number of messages to send per flush. * - * @return int The limit + * @return int The limit */ public function getMessageLimit() { @@ -44,7 +44,7 @@ /** * Sets the time limit (in seconds) per flush. * - * @param int $limit The limit + * @param int $limit The limit */ public function setTimeLimit($limit) { @@ -54,7 +54,7 @@ /** * Gets the time limit (in seconds) per flush. * - * @return int The limit + * @return int The limit */ public function getTimeLimit() { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/DependencyContainer.php libphp-swiftmailer-5.4.1/lib/classes/Swift/DependencyContainer.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/DependencyContainer.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/DependencyContainer.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Dependency Injection container. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_DependencyContainer { @@ -91,9 +91,9 @@ * * @param string $itemName * - * @return mixed - * * @throws Swift_DependencyException If the dependency is not found + * + * @return mixed */ public function lookup($itemName) { @@ -138,6 +138,7 @@ * This method returns the current DependencyContainer instance because it * requires the use of the fluid interface to set the specific details for the * dependency. + * * @see asNewInstanceOf(), asSharedInstanceOf(), asValue() * * @param string $itemName @@ -147,7 +148,7 @@ public function register($itemName) { $this->_store[$itemName] = array(); - $this->_endPoint = & $this->_store[$itemName]; + $this->_endPoint = &$this->_store[$itemName]; return $this; } @@ -163,7 +164,7 @@ */ public function asValue($value) { - $endPoint = & $this->_getEndPoint(); + $endPoint = &$this->_getEndPoint(); $endPoint['lookupType'] = self::TYPE_VALUE; $endPoint['value'] = $value; @@ -179,7 +180,7 @@ */ public function asAliasOf($lookup) { - $endPoint = & $this->_getEndPoint(); + $endPoint = &$this->_getEndPoint(); $endPoint['lookupType'] = self::TYPE_ALIAS; $endPoint['ref'] = $lookup; @@ -201,7 +202,7 @@ */ public function asNewInstanceOf($className) { - $endPoint = & $this->_getEndPoint(); + $endPoint = &$this->_getEndPoint(); $endPoint['lookupType'] = self::TYPE_INSTANCE; $endPoint['className'] = $className; @@ -219,7 +220,7 @@ */ public function asSharedInstanceOf($className) { - $endPoint = & $this->_getEndPoint(); + $endPoint = &$this->_getEndPoint(); $endPoint['lookupType'] = self::TYPE_SHARED; $endPoint['className'] = $className; @@ -239,7 +240,7 @@ */ public function withDependencies(array $lookups) { - $endPoint = & $this->_getEndPoint(); + $endPoint = &$this->_getEndPoint(); $endPoint['args'] = array(); foreach ($lookups as $lookup) { $this->addConstructorLookup($lookup); @@ -260,7 +261,7 @@ */ public function addConstructorValue($value) { - $endPoint = & $this->_getEndPoint(); + $endPoint = &$this->_getEndPoint(); if (!isset($endPoint['args'])) { $endPoint['args'] = array(); } @@ -281,7 +282,7 @@ */ public function addConstructorLookup($lookup) { - $endPoint = & $this->_getEndPoint(); + $endPoint = &$this->_getEndPoint(); if (!isset($this->_endPoint['args'])) { $endPoint['args'] = array(); } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/DependencyException.php libphp-swiftmailer-5.4.1/lib/classes/Swift/DependencyException.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/DependencyException.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/DependencyException.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * DependencyException gets thrown when a requested dependency is missing. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_DependencyException extends Swift_SwiftException { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/EmbeddedFile.php libphp-swiftmailer-5.4.1/lib/classes/Swift/EmbeddedFile.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/EmbeddedFile.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/EmbeddedFile.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * An embedded file, in a multipart message. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_EmbeddedFile extends Swift_Mime_EmbeddedFile { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Encoder/Base64Encoder.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Encoder/Base64Encoder.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Encoder/Base64Encoder.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Encoder/Base64Encoder.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Handles Base 64 Encoding in Swift Mailer. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Encoder_Base64Encoder implements Swift_Encoder { @@ -22,9 +22,9 @@ * If the first line needs to be shorter, indicate the difference with * $firstLineOffset. * - * @param string $string to encode - * @param int $firstLineOffset - * @param int $maxLineLength optional, 0 indicates the default of 76 bytes + * @param string $string to encode + * @param int $firstLineOffset + * @param int $maxLineLength optional, 0 indicates the default of 76 bytes * * @return string */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Encoder/QpEncoder.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Encoder/QpEncoder.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Encoder/QpEncoder.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Encoder/QpEncoder.php 2015-06-06 14:19:39.000000000 +0000 @@ -13,7 +13,7 @@ * * Possibly the most accurate RFC 2045 QP implementation found in PHP. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Encoder_QpEncoder implements Swift_Encoder { @@ -37,26 +37,26 @@ * @var string[] */ protected static $_qpMap = array( - 0 => '=00', 1 => '=01', 2 => '=02', 3 => '=03', 4 => '=04', - 5 => '=05', 6 => '=06', 7 => '=07', 8 => '=08', 9 => '=09', - 10 => '=0A', 11 => '=0B', 12 => '=0C', 13 => '=0D', 14 => '=0E', - 15 => '=0F', 16 => '=10', 17 => '=11', 18 => '=12', 19 => '=13', - 20 => '=14', 21 => '=15', 22 => '=16', 23 => '=17', 24 => '=18', - 25 => '=19', 26 => '=1A', 27 => '=1B', 28 => '=1C', 29 => '=1D', - 30 => '=1E', 31 => '=1F', 32 => '=20', 33 => '=21', 34 => '=22', - 35 => '=23', 36 => '=24', 37 => '=25', 38 => '=26', 39 => '=27', - 40 => '=28', 41 => '=29', 42 => '=2A', 43 => '=2B', 44 => '=2C', - 45 => '=2D', 46 => '=2E', 47 => '=2F', 48 => '=30', 49 => '=31', - 50 => '=32', 51 => '=33', 52 => '=34', 53 => '=35', 54 => '=36', - 55 => '=37', 56 => '=38', 57 => '=39', 58 => '=3A', 59 => '=3B', - 60 => '=3C', 61 => '=3D', 62 => '=3E', 63 => '=3F', 64 => '=40', - 65 => '=41', 66 => '=42', 67 => '=43', 68 => '=44', 69 => '=45', - 70 => '=46', 71 => '=47', 72 => '=48', 73 => '=49', 74 => '=4A', - 75 => '=4B', 76 => '=4C', 77 => '=4D', 78 => '=4E', 79 => '=4F', - 80 => '=50', 81 => '=51', 82 => '=52', 83 => '=53', 84 => '=54', - 85 => '=55', 86 => '=56', 87 => '=57', 88 => '=58', 89 => '=59', - 90 => '=5A', 91 => '=5B', 92 => '=5C', 93 => '=5D', 94 => '=5E', - 95 => '=5F', 96 => '=60', 97 => '=61', 98 => '=62', 99 => '=63', + 0 => '=00', 1 => '=01', 2 => '=02', 3 => '=03', 4 => '=04', + 5 => '=05', 6 => '=06', 7 => '=07', 8 => '=08', 9 => '=09', + 10 => '=0A', 11 => '=0B', 12 => '=0C', 13 => '=0D', 14 => '=0E', + 15 => '=0F', 16 => '=10', 17 => '=11', 18 => '=12', 19 => '=13', + 20 => '=14', 21 => '=15', 22 => '=16', 23 => '=17', 24 => '=18', + 25 => '=19', 26 => '=1A', 27 => '=1B', 28 => '=1C', 29 => '=1D', + 30 => '=1E', 31 => '=1F', 32 => '=20', 33 => '=21', 34 => '=22', + 35 => '=23', 36 => '=24', 37 => '=25', 38 => '=26', 39 => '=27', + 40 => '=28', 41 => '=29', 42 => '=2A', 43 => '=2B', 44 => '=2C', + 45 => '=2D', 46 => '=2E', 47 => '=2F', 48 => '=30', 49 => '=31', + 50 => '=32', 51 => '=33', 52 => '=34', 53 => '=35', 54 => '=36', + 55 => '=37', 56 => '=38', 57 => '=39', 58 => '=3A', 59 => '=3B', + 60 => '=3C', 61 => '=3D', 62 => '=3E', 63 => '=3F', 64 => '=40', + 65 => '=41', 66 => '=42', 67 => '=43', 68 => '=44', 69 => '=45', + 70 => '=46', 71 => '=47', 72 => '=48', 73 => '=49', 74 => '=4A', + 75 => '=4B', 76 => '=4C', 77 => '=4D', 78 => '=4E', 79 => '=4F', + 80 => '=50', 81 => '=51', 82 => '=52', 83 => '=53', 84 => '=54', + 85 => '=55', 86 => '=56', 87 => '=57', 88 => '=58', 89 => '=59', + 90 => '=5A', 91 => '=5B', 92 => '=5C', 93 => '=5D', 94 => '=5E', + 95 => '=5F', 96 => '=60', 97 => '=61', 98 => '=62', 99 => '=63', 100 => '=64', 101 => '=65', 102 => '=66', 103 => '=67', 104 => '=68', 105 => '=69', 106 => '=6A', 107 => '=6B', 108 => '=6C', 109 => '=6D', 110 => '=6E', 111 => '=6F', 112 => '=70', 113 => '=71', 114 => '=72', @@ -153,9 +153,9 @@ * If the first line needs to be shorter, indicate the difference with * $firstLineOffset. * - * @param string $string to encode - * @param int $firstLineOffset, optional - * @param int $maxLineLength, optional 0 indicates the default of 76 chars + * @param string $string to encode + * @param int $firstLineOffset, optional + * @param int $maxLineLength, optional 0 indicates the default of 76 chars * * @return string */ @@ -170,7 +170,7 @@ $lines = array(); $lNo = 0; $lines[$lNo] = ''; - $currentLine = & $lines[$lNo++]; + $currentLine = &$lines[$lNo++]; $size = $lineLen = 0; $this->_charStream->flushContents(); @@ -198,9 +198,9 @@ } $enc = $this->_encodeByteSequence($bytes, $size); - if ($currentLine && $lineLen+$size >= $thisLineLength) { + if ($currentLine && $lineLen + $size >= $thisLineLength) { $lines[$lNo] = ''; - $currentLine = & $lines[$lNo++]; + $currentLine = &$lines[$lNo++]; $thisLineLength = $maxLineLength; $lineLen = 0; } @@ -249,7 +249,7 @@ /** * Get the next sequence of bytes to read from the char stream. * - * @param int $size number of bytes to read + * @param int $size number of bytes to read * * @return integer[] */ @@ -267,7 +267,7 @@ */ protected function _standardize($string) { - $string = str_replace(array("\t=0D=0A", " =0D=0A", "=0D=0A"), + $string = str_replace(array("\t=0D=0A", ' =0D=0A', '=0D=0A'), array("=09\r\n", "=20\r\n", "\r\n"), $string ); switch ($end = ord(substr($string, -1))) { @@ -280,8 +280,8 @@ } /** - * Make a deep copy of object - */ + * Make a deep copy of object. + */ public function __clone() { $this->_charStream = clone $this->_charStream; diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Encoder/Rfc2231Encoder.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Encoder/Rfc2231Encoder.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Encoder/Rfc2231Encoder.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Encoder/Rfc2231Encoder.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Handles RFC 2231 specified Encoding in Swift Mailer. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Encoder_Rfc2231Encoder implements Swift_Encoder { @@ -36,9 +36,9 @@ * Takes an unencoded string and produces a string encoded according to * RFC 2231 from it. * - * @param string $string - * @param int $firstLineOffset - * @param int $maxLineLength optional, 0 indicates the default of 75 bytes + * @param string $string + * @param int $firstLineOffset + * @param int $maxLineLength optional, 0 indicates the default of 75 bytes * * @return string */ @@ -47,7 +47,7 @@ $lines = array(); $lineCount = 0; $lines[] = ''; - $currentLine = & $lines[$lineCount++]; + $currentLine = &$lines[$lineCount++]; if (0 >= $maxLineLength) { $maxLineLength = 75; @@ -63,7 +63,7 @@ if (0 != strlen($currentLine) && strlen($currentLine.$encodedChar) > $thisLineLength) { $lines[] = ''; - $currentLine = & $lines[$lineCount++]; + $currentLine = &$lines[$lineCount++]; $thisLineLength = $maxLineLength; } $currentLine .= $encodedChar; @@ -83,8 +83,8 @@ } /** - * Make a deep copy of object - */ + * Make a deep copy of object. + */ public function __clone() { $this->_charStream = clone $this->_charStream; diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Encoder.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Encoder.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Encoder.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Encoder.php 2015-06-06 14:19:39.000000000 +0000 @@ -10,6 +10,7 @@ /** * Interface for all Encoder schemes. + * * @author Chris Corbyn */ interface Swift_Encoder extends Swift_Mime_CharsetObserver @@ -17,9 +18,9 @@ /** * Encode a given string to produce an encoded string. * - * @param string $string - * @param int $firstLineOffset if first line needs to be shorter - * @param int $maxLineLength - 0 indicates the default length for this encoding + * @param string $string + * @param int $firstLineOffset if first line needs to be shorter + * @param int $maxLineLength - 0 indicates the default length for this encoding * * @return string */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Encoding.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Encoding.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Encoding.php 1970-01-01 00:00:00.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Encoding.php 2015-06-06 14:19:39.000000000 +0000 @@ -0,0 +1,64 @@ +lookup($key); + } +} diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/CommandEvent.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/CommandEvent.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/CommandEvent.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/CommandEvent.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Generated when a command is sent over an SMTP connection. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Events_CommandEvent extends Swift_Events_EventObject { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/CommandListener.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/CommandListener.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/CommandListener.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/CommandListener.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Listens for Transports to send commands to the server. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Events_CommandListener extends Swift_Events_EventListener { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/EventDispatcher.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/EventDispatcher.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/EventDispatcher.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/EventDispatcher.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Interface for the EventDispatcher which handles the event dispatching layer. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Events_EventDispatcher { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/EventListener.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/EventListener.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/EventListener.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/EventListener.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * An identity interface which all EventListeners must extend. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Events_EventListener { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/EventObject.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/EventObject.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/EventObject.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/EventObject.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A base Event which all Event classes inherit from. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Events_EventObject implements Swift_Events_Event { @@ -44,7 +44,7 @@ /** * Prevent this Event from bubbling any further up the stack. * - * @param bool $cancel, optional + * @param bool $cancel, optional */ public function cancelBubble($cancel = true) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/Event.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/Event.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/Event.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/Event.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * The minimum interface for an Event. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Events_Event { @@ -25,7 +25,7 @@ /** * Prevent this Event from bubbling any further up the stack. * - * @param bool $cancel, optional + * @param bool $cancel, optional */ public function cancelBubble($cancel = true); diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/ResponseEvent.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/ResponseEvent.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/ResponseEvent.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/ResponseEvent.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Generated when a response is received on a SMTP connection. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Events_ResponseEvent extends Swift_Events_EventObject { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/ResponseListener.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/ResponseListener.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/ResponseListener.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/ResponseListener.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Listens for responses from a remote SMTP server. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Events_ResponseListener extends Swift_Events_EventListener { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/SendEvent.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/SendEvent.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/SendEvent.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/SendEvent.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,13 +11,16 @@ /** * Generated when a message is being sent. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Events_SendEvent extends Swift_Events_EventObject { /** Sending has yet to occur */ const RESULT_PENDING = 0x0001; + /** Email is spooled, ready to be sent */ + const RESULT_SPOOLED = 0x0011; + /** Sending was successful */ const RESULT_SUCCESS = 0x0010; @@ -104,7 +107,7 @@ /** * Set the result of sending. * - * @param int $result + * @param int $result */ public function setResult($result) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/SendListener.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/SendListener.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/SendListener.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/SendListener.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Listens for Messages being sent from within the Transport system. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Events_SendListener extends Swift_Events_EventListener { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/SimpleEventDispatcher.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/SimpleEventDispatcher.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/SimpleEventDispatcher.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/SimpleEventDispatcher.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * The EventDispatcher which handles the event dispatching layer. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Events_SimpleEventDispatcher implements Swift_Events_EventDispatcher { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/TransportChangeEvent.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/TransportChangeEvent.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/TransportChangeEvent.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/TransportChangeEvent.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Generated when the state of a Transport is changed (i.e. stopped/started). * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Events_TransportChangeEvent extends Swift_Events_EventObject { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/TransportChangeListener.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/TransportChangeListener.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/TransportChangeListener.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/TransportChangeListener.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Listens for changes within the Transport system. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Events_TransportChangeListener extends Swift_Events_EventListener { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/TransportExceptionEvent.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/TransportExceptionEvent.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/TransportExceptionEvent.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/TransportExceptionEvent.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Generated when a TransportException is thrown from the Transport system. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Events_TransportExceptionEvent extends Swift_Events_EventObject { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/TransportExceptionListener.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/TransportExceptionListener.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Events/TransportExceptionListener.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Events/TransportExceptionListener.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Listens for Exceptions thrown from within the Transport system. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Events_TransportExceptionListener extends Swift_Events_EventListener { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/FailoverTransport.php libphp-swiftmailer-5.4.1/lib/classes/Swift/FailoverTransport.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/FailoverTransport.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/FailoverTransport.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Contains a list of redundant Transports so when one fails, the next is used. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_FailoverTransport extends Swift_Transport_FailoverTransport { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/FileSpool.php libphp-swiftmailer-5.4.1/lib/classes/Swift/FileSpool.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/FileSpool.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/FileSpool.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,8 +11,8 @@ /** * Stores Messages on the filesystem. * - * @author Fabien Potencier - * @author Xavier De Cock + * @author Fabien Potencier + * @author Xavier De Cock */ class Swift_FileSpool extends Swift_ConfigurableSpool { @@ -20,7 +20,7 @@ private $_path; /** - * File WriteRetry Limit + * File WriteRetry Limit. * * @var int */ @@ -73,7 +73,7 @@ * * Default, is ten and allows over 64^20 different fileNames * - * @param int $limit + * @param int $limit */ public function setRetryLimit($limit) { @@ -85,9 +85,9 @@ * * @param Swift_Mime_Message $message The message to store * - * @return bool - * * @throws Swift_IoException + * + * @return bool */ public function queueMessage(Swift_Mime_Message $message) { @@ -114,17 +114,17 @@ /** * Execute a recovery if for any reason a process is sending for too long. * - * @param int $timeout in second Defaults is for very slow smtp responses + * @param int $timeout in second Defaults is for very slow smtp responses */ public function recover($timeout = 900) { foreach (new DirectoryIterator($this->_path) as $file) { $file = $file->getRealPath(); - if (substr($file, - 16) == '.message.sending') { + if (substr($file, -16) == '.message.sending') { $lockedtime = filectime($file); if ((time() - $lockedtime) > $timeout) { - rename($file, substr($file, 0, - 8)); + rename($file, substr($file, 0, -8)); } } } @@ -136,7 +136,7 @@ * @param Swift_Transport $transport A transport instance * @param string[] $failedRecipients An array of failures by-reference * - * @return int The number of sent e-mail's + * @return int The number of sent e-mail's */ public function flushQueue(Swift_Transport $transport, &$failedRecipients = null) { @@ -189,14 +189,14 @@ /** * Returns a random string needed to generate a fileName for the queue. * - * @param int $count + * @param int $count * * @return string */ protected function getRandomString($count) { // This string MUST stay FS safe, avoid special chars - $base = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-."; + $base = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-'; $ret = ''; $strlen = strlen($base); for ($i = 0; $i < $count; ++$i) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/FileStream.php libphp-swiftmailer-5.4.1/lib/classes/Swift/FileStream.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/FileStream.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/FileStream.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * An OutputByteStream which specifically reads from a file. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_FileStream extends Swift_OutputByteStream { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Filterable.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Filterable.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Filterable.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Filterable.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Allows StreamFilters to operate on a stream. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Filterable { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Image.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Image.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Image.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Image.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * An image, embedded in a multipart message. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Image extends Swift_EmbeddedFile { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/InputByteStream.php libphp-swiftmailer-5.4.1/lib/classes/Swift/InputByteStream.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/InputByteStream.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/InputByteStream.php 2015-06-06 14:19:39.000000000 +0000 @@ -14,7 +14,7 @@ * Classes implementing this interface may use a subsystem which requires less * memory than working with large strings of data. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_InputByteStream { @@ -30,9 +30,9 @@ * * @param string $bytes * - * @return int - * * @throws Swift_IoException + * + * @return int */ public function write($bytes); diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/IoException.php libphp-swiftmailer-5.4.1/lib/classes/Swift/IoException.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/IoException.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/IoException.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,17 +11,19 @@ /** * I/O Exception class. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_IoException extends Swift_SwiftException { /** * Create a new IoException with $message. * - * @param string $message + * @param string $message + * @param int $code + * @param Exception $previous */ - public function __construct($message) + public function __construct($message, $code = 0, Exception $previous = null) { - parent::__construct($message); + parent::__construct($message, $code, $previous); } } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/KeyCache/ArrayKeyCache.php libphp-swiftmailer-5.4.1/lib/classes/Swift/KeyCache/ArrayKeyCache.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/KeyCache/ArrayKeyCache.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/KeyCache/ArrayKeyCache.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A basic KeyCache backed by an array. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache { @@ -45,10 +45,10 @@ * * @see MODE_WRITE, MODE_APPEND * - * @param string $nsKey - * @param string $itemKey - * @param string $string - * @param int $mode + * @param string $nsKey + * @param string $itemKey + * @param string $string + * @param int $mode */ public function setString($nsKey, $itemKey, $string, $mode) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/KeyCache/DiskKeyCache.php libphp-swiftmailer-5.4.1/lib/classes/Swift/KeyCache/DiskKeyCache.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/KeyCache/DiskKeyCache.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/KeyCache/DiskKeyCache.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A KeyCache which streams to and from disk. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_KeyCache_DiskKeyCache implements Swift_KeyCache { @@ -74,10 +74,10 @@ * * @see MODE_WRITE, MODE_APPEND * - * @param string $nsKey - * @param string $itemKey - * @param string $string - * @param int $mode + * @param string $nsKey + * @param string $itemKey + * @param string $string + * @param int $mode * * @throws Swift_IoException */ @@ -167,9 +167,9 @@ * @param string $nsKey * @param string $itemKey * - * @return string - * * @throws Swift_IoException + * + * @return string */ public function getString($nsKey, $itemKey) { @@ -280,9 +280,9 @@ /** * Get a file handle on the cache item. * - * @param string $nsKey - * @param string $itemKey - * @param int $position + * @param string $nsKey + * @param string $itemKey + * @param int $position * * @return resource */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/KeyCache/KeyCacheInputStream.php libphp-swiftmailer-5.4.1/lib/classes/Swift/KeyCache/KeyCacheInputStream.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/KeyCache/KeyCacheInputStream.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/KeyCache/KeyCacheInputStream.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Writes data to a KeyCache using a stream. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_KeyCache_KeyCacheInputStream extends Swift_InputByteStream { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/KeyCache/NullKeyCache.php libphp-swiftmailer-5.4.1/lib/classes/Swift/KeyCache/NullKeyCache.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/KeyCache/NullKeyCache.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/KeyCache/NullKeyCache.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A null KeyCache that does not cache at all. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_KeyCache_NullKeyCache implements Swift_KeyCache { @@ -20,10 +20,10 @@ * * @see MODE_WRITE, MODE_APPEND * - * @param string $nsKey - * @param string $itemKey - * @param string $string - * @param int $mode + * @param string $nsKey + * @param string $itemKey + * @param string $string + * @param int $mode */ public function setString($nsKey, $itemKey, $string, $mode) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php libphp-swiftmailer-5.4.1/lib/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Writes data to a KeyCache using a stream. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_KeyCache_SimpleKeyCacheInputStream implements Swift_KeyCache_KeyCacheInputStream { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/KeyCache.php libphp-swiftmailer-5.4.1/lib/classes/Swift/KeyCache.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/KeyCache.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/KeyCache.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Provides a mechanism for storing data using two keys. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_KeyCache { @@ -26,10 +26,10 @@ * * @see MODE_WRITE, MODE_APPEND * - * @param string $nsKey - * @param string $itemKey - * @param string $string - * @param int $mode + * @param string $nsKey + * @param string $itemKey + * @param string $string + * @param int $mode */ public function setString($nsKey, $itemKey, $string, $mode); diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/LoadBalancedTransport.php libphp-swiftmailer-5.4.1/lib/classes/Swift/LoadBalancedTransport.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/LoadBalancedTransport.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/LoadBalancedTransport.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Redundantly and rotationally uses several Transport implementations when sending. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_LoadBalancedTransport extends Swift_Transport_LoadBalancedTransport { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mailer/ArrayRecipientIterator.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mailer/ArrayRecipientIterator.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mailer/ArrayRecipientIterator.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mailer/ArrayRecipientIterator.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Wraps a standard PHP array in an iterator. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mailer_ArrayRecipientIterator implements Swift_Mailer_RecipientIterator { @@ -44,7 +44,7 @@ /** * Returns an array where the keys are the addresses of recipients and the - * values are the names. e.g. ('foo@bar' => 'Foo') or ('foo@bar' => NULL) + * values are the names. e.g. ('foo@bar' => 'Foo') or ('foo@bar' => NULL). * * @return array */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mailer/RecipientIterator.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mailer/RecipientIterator.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mailer/RecipientIterator.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mailer/RecipientIterator.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Provides an abstract way of specifying recipients for batch sending. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Mailer_RecipientIterator { @@ -24,7 +24,7 @@ /** * Returns an array where the keys are the addresses of recipients and the - * values are the names. e.g. ('foo@bar' => 'Foo') or ('foo@bar' => NULL) + * values are the names. e.g. ('foo@bar' => 'Foo') or ('foo@bar' => NULL). * * @return array */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mailer.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mailer.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mailer.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mailer.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Swift Mailer class. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mailer { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/MailTransport.php libphp-swiftmailer-5.4.1/lib/classes/Swift/MailTransport.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/MailTransport.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/MailTransport.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Sends Messages using the mail() function. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_MailTransport extends Swift_Transport_MailTransport { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/MemorySpool.php libphp-swiftmailer-5.4.1/lib/classes/Swift/MemorySpool.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/MemorySpool.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/MemorySpool.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Stores Messages in memory. * - * @author Fabien Potencier + * @author Fabien Potencier */ class Swift_MemorySpool implements Swift_Spool { @@ -46,7 +46,7 @@ * * @param Swift_Mime_Message $message The message to store * - * @return bool Whether the operation has succeeded + * @return bool Whether the operation has succeeded */ public function queueMessage(Swift_Mime_Message $message) { @@ -62,7 +62,7 @@ * @param Swift_Transport $transport A transport instance * @param string[] $failedRecipients An array of failures by-reference * - * @return int The number of sent emails + * @return int The number of sent emails */ public function flushQueue(Swift_Transport $transport, &$failedRecipients = null) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Message.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Message.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Message.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Message.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * The Message class for building emails. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Message extends Swift_Mime_SimpleMessage { @@ -95,6 +95,7 @@ * Attach a new signature handler to the message. * * @param Swift_Signer $signer + * * @return Swift_Message */ public function attachSigner(Swift_Signer $signer) @@ -112,6 +113,7 @@ * Attach a new signature handler to the message. * * @param Swift_Signer $signer + * * @return Swift_Message */ public function detachSigner(Swift_Signer $signer) @@ -187,7 +189,7 @@ } /** - * loops through signers and apply the signatures + * loops through signers and apply the signatures. */ protected function doSign() { @@ -213,7 +215,7 @@ } /** - * save the message before any signature is applied + * save the message before any signature is applied. */ protected function saveMessage() { @@ -227,7 +229,8 @@ } /** - * save the original headers + * save the original headers. + * * @param array $altered */ protected function saveHeaders(array $altered) @@ -242,7 +245,7 @@ } /** - * Remove or restore altered headers + * Remove or restore altered headers. */ protected function restoreHeaders() { @@ -258,7 +261,7 @@ } /** - * Restore message body + * Restore message body. */ protected function restoreMessage() { @@ -268,4 +271,21 @@ $this->restoreHeaders(); $this->savedMessage = array(); } + + /** + * Clone Message Signers. + * + * @see Swift_Mime_SimpleMimeEntity::__clone() + */ + public function __clone() + { + parent::__clone(); + foreach ($this->bodySigners as $key => $bodySigner) { + $this->bodySigners[$key] = clone($bodySigner); + } + + foreach ($this->headerSigners as $key => $headerSigner) { + $this->headerSigners[$key] = clone($headerSigner); + } + } } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Attachment.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Attachment.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Attachment.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Attachment.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * An attachment, in a multipart message. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_Attachment extends Swift_Mime_SimpleMimeEntity { @@ -115,7 +115,7 @@ /** * Set the file size of this attachment. * - * @param int $size + * @param int $size * * @return Swift_Mime_Attachment */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/CharsetObserver.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/CharsetObserver.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/CharsetObserver.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/CharsetObserver.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Observes changes in an Mime entity's character set. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Mime_CharsetObserver { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Handles Base 64 Transfer Encoding in Swift Mailer. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_ContentEncoder_Base64ContentEncoder extends Swift_Encoder_Base64Encoder implements Swift_Mime_ContentEncoder { @@ -30,9 +30,42 @@ } $remainder = 0; + $base64ReadBufferRemainderBytes = null; - while (false !== $bytes = $os->read(8190)) { - $encoded = base64_encode($bytes); + // To reduce memory usage, the output buffer is streamed to the input buffer like so: + // Output Stream => base64encode => wrap line length => Input Stream + // HOWEVER it's important to note that base64_encode() should only be passed whole triplets of data (except for the final chunk of data) + // otherwise it will assume the input data has *ended* and it will incorrectly pad/terminate the base64 data mid-stream. + // We use $base64ReadBufferRemainderBytes to carry over 1-2 "remainder" bytes from the each chunk from OutputStream and pre-pend those onto the + // chunk of bytes read in the next iteration. + // When the OutputStream is empty, we must flush any remainder bytes. + while (true) { + $readBytes = $os->read(8192); + $atEOF = ($readBytes === false); + + if ($atEOF) { + $streamTheseBytes = $base64ReadBufferRemainderBytes; + } else { + $streamTheseBytes = $base64ReadBufferRemainderBytes.$readBytes; + } + $base64ReadBufferRemainderBytes = null; + $bytesLength = strlen($streamTheseBytes); + + if ($bytesLength === 0) { // no data left to encode + break; + } + + // if we're not on the last block of the ouput stream, make sure $streamTheseBytes ends with a complete triplet of data + // and carry over remainder 1-2 bytes to the next loop iteration + if (!$atEOF) { + $excessBytes = $bytesLength % 3; + if ($excessBytes !== 0) { + $base64ReadBufferRemainderBytes = substr($streamTheseBytes, -$excessBytes); + $streamTheseBytes = substr($streamTheseBytes, 0, $bytesLength - $excessBytes); + } + } + + $encoded = base64_encode($streamTheseBytes); $encodedTransformed = ''; $thisMaxLineLength = $maxLineLength - $remainder - $firstLineOffset; @@ -51,6 +84,10 @@ } $is->write($encodedTransformed); + + if ($atEOF) { + break; + } } } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Handles Quoted Printable (QP) Transfer Encoding in Swift Mailer using the PHP core function. * - * @author Lars Strojny + * @author Lars Strojny */ class Swift_Mime_ContentEncoder_NativeQpContentEncoder implements Swift_Mime_ContentEncoder { @@ -77,13 +77,13 @@ /** * Encode a given string to produce an encoded string. * - * @param string $string - * @param int $firstLineOffset if first line needs to be shorter - * @param int $maxLineLength 0 indicates the default length for this encoding - * - * @return string + * @param string $string + * @param int $firstLineOffset if first line needs to be shorter + * @param int $maxLineLength 0 indicates the default length for this encoding * * @throws RuntimeException + * + * @return string */ public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) { @@ -107,7 +107,7 @@ // transform CR or LF to CRLF $string = preg_replace('~=0D(?!=0A)|(? $length) { $lines[] = ''; - $currentLine = & $lines[$lineCount++]; + $currentLine = &$lines[$lineCount++]; } $currentLine .= $chunk; } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Handles Quoted Printable (QP) Transfer Encoding in Swift Mailer. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_ContentEncoder_QpContentEncoder extends Swift_Encoder_QpEncoder implements Swift_Mime_ContentEncoder { @@ -95,7 +95,7 @@ } $enc = $this->_encodeByteSequence($bytes, $size); - if ($currentLine && $lineLen+$size >= $thisLineLength) { + if ($currentLine && $lineLen + $size >= $thisLineLength) { $is->write($prepend.$this->_standardize($currentLine)); $currentLine = ''; $prepend = "=\r\n"; diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php 2015-06-06 14:19:39.000000000 +0000 @@ -13,7 +13,7 @@ * * Switches on the best QP encoder implementation for current charset. * - * @author Jean-François Simon + * @author Jean-François Simon */ class Swift_Mime_ContentEncoder_QpContentEncoderProxy implements Swift_Mime_ContentEncoder { @@ -47,7 +47,7 @@ } /** - * Make a deep copy of object + * Make a deep copy of object. */ public function __clone() { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/ContentEncoder/RawContentEncoder.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/ContentEncoder/RawContentEncoder.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/ContentEncoder/RawContentEncoder.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/ContentEncoder/RawContentEncoder.php 2015-06-06 14:19:39.000000000 +0000 @@ -12,16 +12,17 @@ * Handles raw Transfer Encoding in Swift Mailer. * * - * @author Sebastiaan Stok + * @author Sebastiaan Stok */ class Swift_Mime_ContentEncoder_RawContentEncoder implements Swift_Mime_ContentEncoder { /** * Encode a given string to produce an encoded string. * - * @param string $string - * @param int $firstLineOffset ignored - * @param int $maxLineLength ignored + * @param string $string + * @param int $firstLineOffset ignored + * @param int $maxLineLength ignored + * * @return string */ public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/ContentEncoder.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/ContentEncoder.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/ContentEncoder.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/ContentEncoder.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Interface for all Transfer Encoding schemes. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Mime_ContentEncoder extends Swift_Encoder { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/EmbeddedFile.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/EmbeddedFile.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/EmbeddedFile.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/EmbeddedFile.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * An embedded file, in a multipart message. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_EmbeddedFile extends Swift_Mime_Attachment { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/EncodingObserver.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/EncodingObserver.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/EncodingObserver.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/EncodingObserver.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Observes changes for a Mime entity's ContentEncoder. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Mime_EncodingObserver { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/HeaderEncoder/Base64HeaderEncoder.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/HeaderEncoder/Base64HeaderEncoder.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/HeaderEncoder/Base64HeaderEncoder.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/HeaderEncoder/Base64HeaderEncoder.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Handles Base64 (B) Header Encoding in Swift Mailer. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_HeaderEncoder_Base64HeaderEncoder extends Swift_Encoder_Base64Encoder implements Swift_Mime_HeaderEncoder { @@ -32,10 +32,10 @@ * If the charset is iso-2022-jp, it uses mb_encode_mimeheader instead of * default encodeString, otherwise pass to the parent method. * - * @param string $string string to encode - * @param int $firstLineOffset - * @param int $maxLineLength optional, 0 indicates the default of 76 bytes - * @param string $charset + * @param string $string string to encode + * @param int $firstLineOffset + * @param int $maxLineLength optional, 0 indicates the default of 76 bytes + * @param string $charset * * @return string */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Handles Quoted Printable (Q) Header Encoding in Swift Mailer. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_HeaderEncoder_QpHeaderEncoder extends Swift_Encoder_QpEncoder implements Swift_Mime_HeaderEncoder { @@ -50,9 +50,9 @@ /** * Takes an unencoded string and produces a QP encoded string from it. * - * @param string $string string to encode - * @param int $firstLineOffset optional - * @param int $maxLineLength optional, 0 indicates the default of 76 chars + * @param string $string string to encode + * @param int $firstLineOffset optional + * @param int $maxLineLength optional, 0 indicates the default of 76 chars * * @return string */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/HeaderEncoder.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/HeaderEncoder.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/HeaderEncoder.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/HeaderEncoder.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Interface for all Header Encoding schemes. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Mime_HeaderEncoder extends Swift_Encoder { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/HeaderFactory.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/HeaderFactory.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/HeaderFactory.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/HeaderFactory.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Creates MIME headers. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Mime_HeaderFactory extends Swift_Mime_CharsetObserver { @@ -28,8 +28,8 @@ /** * Create a new Date header using $timestamp (UNIX time). * - * @param string $name - * @param int $timestamp + * @param string $name + * @param int $timestamp * * @return Swift_Mime_Header */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Header.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Header.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Header.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Header.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A MIME Header. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Mime_Header { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Headers/AbstractHeader.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Headers/AbstractHeader.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Headers/AbstractHeader.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Headers/AbstractHeader.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * An abstract base MIME Header. * - * @author Chris Corbyn + * @author Chris Corbyn */ abstract class Swift_Mime_Headers_AbstractHeader implements Swift_Mime_Header { @@ -177,7 +177,7 @@ /** * Set the maximum length of lines in the header (excluding EOL). * - * @param int $lineLength + * @param int $lineLength */ public function setMaxLineLength($lineLength) { @@ -198,9 +198,9 @@ /** * Get this Header rendered as a RFC 2822 compliant string. * - * @return string - * * @throws Swift_RfcComplianceException + * + * @return string */ public function toString() { @@ -357,8 +357,8 @@ /** * Get a token as an encoded word for safe insertion into headers. * - * @param string $token token to encode - * @param int $firstLineOffset optional + * @param string $token token to encode + * @param int $firstLineOffset optional * * @return string */ @@ -431,7 +431,7 @@ /** * Clear the cached value if $condition is met. * - * @param bool $condition + * @param bool $condition */ protected function clearCachedValueIf($condition) { @@ -479,7 +479,7 @@ $lineCount = 0; $headerLines = array(); $headerLines[] = $this->_name.': '; - $currentLine = & $headerLines[$lineCount++]; + $currentLine = &$headerLines[$lineCount++]; // Build all tokens back into compliant header foreach ($tokens as $i => $token) { @@ -488,7 +488,7 @@ ($i > 0 && strlen($currentLine.$token) > $this->_lineLength) && 0 < strlen($currentLine)) { $headerLines[] = ''; - $currentLine = & $headerLines[$lineCount++]; + $currentLine = &$headerLines[$lineCount++]; } // Append token to the line diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Headers/DateHeader.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Headers/DateHeader.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Headers/DateHeader.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Headers/DateHeader.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A Date MIME Header for Swift Mailer. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_Headers_DateHeader extends Swift_Mime_Headers_AbstractHeader { @@ -59,7 +59,7 @@ * * This method takes a UNIX timestamp. * - * @param int $model + * @param int $model */ public function setFieldBodyModel($model) { @@ -91,7 +91,7 @@ /** * Set the UNIX timestamp of the Date in this Header. * - * @param int $timestamp + * @param int $timestamp */ public function setTimestamp($timestamp) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Headers/IdentificationHeader.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Headers/IdentificationHeader.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Headers/IdentificationHeader.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Headers/IdentificationHeader.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * An ID MIME Header for something like Message-ID or Content-ID. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_Headers_IdentificationHeader extends Swift_Mime_Headers_AbstractHeader { @@ -139,9 +139,9 @@ * * @see toString() * - * @return string - * * @throws Swift_RfcComplianceException + * + * @return string */ public function getFieldBody() { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Headers/MailboxHeader.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Headers/MailboxHeader.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Headers/MailboxHeader.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Headers/MailboxHeader.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A Mailbox Address MIME Header for something like From or Sender. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_Headers_MailboxHeader extends Swift_Mime_Headers_AbstractHeader { @@ -68,9 +68,9 @@ * * This method returns an associative array like {@link getNameAddresses()} * - * @return array - * * @throws Swift_RfcComplianceException + * + * @return array */ public function getFieldBodyModel() { @@ -128,9 +128,9 @@ * @see getNameAddresses() * @see toString() * - * @return string[] - * * @throws Swift_RfcComplianceException + * + * @return string[] */ public function getNameAddressStrings() { @@ -224,9 +224,9 @@ * * @see toString() * - * @return string - * * @throws Swift_RfcComplianceException + * + * @return string */ public function getFieldBody() { @@ -270,8 +270,8 @@ /** * Produces a compliant, formatted display-name based on the string given. * - * @param string $displayName as displayed - * @param bool $shorten the first line to make remove for header name + * @param string $displayName as displayed + * @param bool $shorten the first line to make remove for header name * * @return string */ @@ -287,9 +287,9 @@ * * @param string[] $mailboxes * - * @return string - * * @throws Swift_RfcComplianceException + * + * @return string */ protected function createMailboxListString(array $mailboxes) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Headers/OpenDKIMHeader.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Headers/OpenDKIMHeader.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Headers/OpenDKIMHeader.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Headers/OpenDKIMHeader.php 2015-06-06 14:19:39.000000000 +0000 @@ -9,9 +9,9 @@ */ /** - * An OpenDKIM Specific Header using only raw header datas without encoding + * An OpenDKIM Specific Header using only raw header datas without encoding. * - * @author De Cock Xavier + * @author De Cock Xavier */ class Swift_Mime_Headers_OpenDKIMHeader implements Swift_Mime_Header { @@ -23,7 +23,8 @@ private $_value; /** - * The name of this Header + * The name of this Header. + * * @var string */ private $_fieldName; @@ -118,16 +119,17 @@ } /** - * Set the Header FieldName - * @see Swift_Mime_Header::getFieldName() - */ + * Set the Header FieldName. + * + * @see Swift_Mime_Header::getFieldName() + */ public function getFieldName() { return $this->_fieldName; } /** - * Ignored + * Ignored. */ public function setCharset($charset) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * An abstract base MIME Header. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_Headers_ParameterizedHeader extends Swift_Mime_Headers_UnstructuredHeader implements Swift_Mime_ParameterizedHeader { @@ -160,7 +160,7 @@ foreach ($this->_params as $name => $value) { if (!is_null($value)) { // Add the semi-colon separator - $tokens[count($tokens)-1] .= ';'; + $tokens[count($tokens) - 1] .= ';'; $tokens = array_merge($tokens, $this->generateTokenLines( ' '.$this->_createParameter($name, $value) )); @@ -235,9 +235,9 @@ /** * Returns the parameter value from the "=" and beyond. * - * @param string $value to append - * @param bool $encoded - * @param bool $firstLine + * @param string $value to append + * @param bool $encoded + * @param bool $firstLine * * @return string */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Headers/PathHeader.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Headers/PathHeader.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Headers/PathHeader.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Headers/PathHeader.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A Path Header in Swift Mailer, such a Return-Path. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_Headers_PathHeader extends Swift_Mime_Headers_AbstractHeader { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A Simple MIME Header. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_Headers_UnstructuredHeader extends Swift_Mime_Headers_AbstractHeader { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/HeaderSet.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/HeaderSet.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/HeaderSet.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/HeaderSet.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A collection of MIME headers. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Mime_HeaderSet extends Swift_Mime_CharsetObserver { @@ -26,8 +26,8 @@ /** * Add a new Date header using $timestamp (UNIX time). * - * @param string $name - * @param int $timestamp + * @param string $name + * @param int $timestamp */ public function addDateHeader($name, $timestamp = null); @@ -69,8 +69,8 @@ * * If multiple headers match, the actual one may be specified by $index. * - * @param string $name - * @param int $index + * @param string $name + * @param int $index * * @return bool */ @@ -95,8 +95,8 @@ * If multiple headers match, the actual one may be specified by $index. * Returns NULL if none present. * - * @param string $name - * @param int $index + * @param string $name + * @param int $index * * @return Swift_Mime_Header */ @@ -112,19 +112,19 @@ public function getAll($name = null); /** - * Return the name of all Headers + * Return the name of all Headers. * * @return array */ public function listAll(); - /** + /** * Remove the header with the given $name if it's set. * * If multiple headers match, the actual one may be specified by $index. * - * @param string $name - * @param int $index + * @param string $name + * @param int $index */ public function remove($name, $index = 0); diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Message.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Message.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/Message.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/Message.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A Message (RFC 2822) object. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Mime_Message extends Swift_Mime_MimeEntity { @@ -39,7 +39,7 @@ /** * Set the origination date of the message as a UNIX timestamp. * - * @param int $date + * @param int $date */ public function setDate($date); diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/MimeEntity.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/MimeEntity.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/MimeEntity.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/MimeEntity.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A MIME entity, such as an attachment. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Mime_MimeEntity extends Swift_Mime_CharsetObserver, Swift_Mime_EncodingObserver { @@ -31,6 +31,7 @@ * Get the level at which this entity shall be nested in final document. * * The lower the value, the more outermost the entity will be nested. + * * @see LEVEL_TOP, LEVEL_MIXED, LEVEL_RELATED, LEVEL_ALTERNATIVE * * @return int @@ -39,6 +40,7 @@ /** * Get the qualified content-type of this mime entity. + * * @return string */ public function getContentType(); diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/MimePart.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/MimePart.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/MimePart.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/MimePart.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A MIME part, in a multipart message. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_MimePart extends Swift_Mime_SimpleMimeEntity { @@ -136,7 +136,7 @@ /** * Turn delsp on or off for this entity. * - * @param bool $delsp + * @param bool $delsp * * @return Swift_Mime_MimePart */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/ParameterizedHeader.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/ParameterizedHeader.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/ParameterizedHeader.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/ParameterizedHeader.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A MIME Header with parameters. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Mime_ParameterizedHeader extends Swift_Mime_Header { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/SimpleHeaderFactory.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/SimpleHeaderFactory.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/SimpleHeaderFactory.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/SimpleHeaderFactory.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Creates MIME headers. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_SimpleHeaderFactory implements Swift_Mime_HeaderFactory { @@ -64,8 +64,9 @@ /** * Create a new Date header using $timestamp (UNIX time). - * @param string $name - * @param int|null $timestamp + * + * @param string $name + * @param int|null $timestamp * * @return Swift_Mime_Header */ @@ -179,8 +180,8 @@ } /** - * Make a deep copy of object - */ + * Make a deep copy of object. + */ public function __clone() { $this->_encoder = clone $this->_encoder; diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/SimpleHeaderSet.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/SimpleHeaderSet.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/SimpleHeaderSet.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/SimpleHeaderSet.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A collection of MIME headers. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_SimpleHeaderSet implements Swift_Mime_HeaderSet { @@ -71,8 +71,8 @@ /** * Add a new Date header using $timestamp (UNIX time). * - * @param string $name - * @param int $timestamp + * @param string $name + * @param int $timestamp */ public function addDateHeader($name, $timestamp = null) { @@ -131,8 +131,8 @@ * * If multiple headers match, the actual one may be specified by $index. * - * @param string $name - * @param int $index + * @param string $name + * @param int $index * * @return bool */ @@ -166,8 +166,8 @@ * If multiple headers match, the actual one may be specified by $index. * Returns NULL if none present. * - * @param string $name - * @param int $index + * @param string $name + * @param int $index * * @return Swift_Mime_Header */ @@ -207,7 +207,7 @@ } /** - * Return the name of all Headers + * Return the name of all Headers. * * @return array */ @@ -221,13 +221,13 @@ return array_keys($headers); } - /** + /** * Remove the header with the given $name if it's set. * * If multiple headers match, the actual one may be specified by $index. * - * @param string $name - * @param int $index + * @param string $name + * @param int $index */ public function remove($name, $index = 0) { @@ -382,8 +382,8 @@ } /** - * Make a deep copy of object - */ + * Make a deep copy of object. + */ public function __clone() { $this->_factory = clone $this->_factory; diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/SimpleMessage.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/SimpleMessage.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/SimpleMessage.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/SimpleMessage.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * The default email message class. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime_Message { @@ -91,7 +91,7 @@ /** * Set the date at which this message was created. * - * @param int $date + * @param int $date * * @return Swift_Mime_SimpleMessage */ @@ -199,8 +199,8 @@ * If $name is passed and the first parameter is a string, this name will be * associated with the address. * - * @param string $addresses - * @param string $name optional + * @param string|array $addresses + * @param string $name optional * * @return Swift_Mime_SimpleMessage */ @@ -445,7 +445,7 @@ * * The value is an integer where 1 is the highest priority and 5 is the lowest. * - * @param int $priority + * @param int $priority * * @return Swift_Mime_SimpleMessage */ @@ -491,7 +491,7 @@ } /** - * Ask for a delivery receipt from the recipient to be sent to $addresses + * Ask for a delivery receipt from the recipient to be sent to $addresses. * * @param array $addresses * diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/SimpleMimeEntity.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/SimpleMimeEntity.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Mime/SimpleMimeEntity.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Mime/SimpleMimeEntity.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A MIME entity, in a multipart message. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity { @@ -249,7 +249,7 @@ * * Though not enforced by the library, lines should not exceed 1000 chars. * - * @param int $length + * @param int $length * * @return Swift_Mime_SimpleMimeEntity */ @@ -263,7 +263,7 @@ /** * Get all children added to this entity. * - * @return array of Swift_Mime_Entity + * @return Swift_Mime_MimeEntity[] */ public function getChildren() { @@ -273,8 +273,8 @@ /** * Set all children of this entity. * - * @param array $children Swift_Mime_Entity instances - * @param int $compoundLevel For internal use only + * @param Swift_Mime_MimeEntity[] $children + * @param int $compoundLevel For internal use only * * @return Swift_Mime_SimpleMimeEntity */ @@ -426,9 +426,9 @@ * * @param string $boundary * - * @return Swift_Mime_SimpleMimeEntity - * * @throws Swift_RfcComplianceException + * + * @return Swift_Mime_SimpleMimeEntity */ public function setBoundary($boundary) { @@ -576,7 +576,7 @@ } /** - * Get the name of the header that provides the ID of this entity + * Get the name of the header that provides the ID of this entity. */ protected function _getIdField() { @@ -702,6 +702,8 @@ $string .= $bytes; } + $os->setReadPointer(0); + return $string; } @@ -849,14 +851,13 @@ } /** - * Make a deep copy of object + * Make a deep copy of object. */ public function __clone() { $this->_headers = clone $this->_headers; $this->_encoder = clone $this->_encoder; $this->_cacheKey = uniqid(); - $this->generateId(); $children = array(); foreach ($this->_children as $pos => $child) { $children[$pos] = clone $child; diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/MimePart.php libphp-swiftmailer-5.4.1/lib/classes/Swift/MimePart.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/MimePart.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/MimePart.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A MIME part, in a multipart message. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_MimePart extends Swift_Mime_MimePart { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/NullTransport.php libphp-swiftmailer-5.4.1/lib/classes/Swift/NullTransport.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/NullTransport.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/NullTransport.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Pretends messages have been sent, but just ignores them. * - * @author Fabien Potencier + * @author Fabien Potencier */ class Swift_NullTransport extends Swift_Transport_NullTransport { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/OutputByteStream.php libphp-swiftmailer-5.4.1/lib/classes/Swift/OutputByteStream.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/OutputByteStream.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/OutputByteStream.php 2015-06-06 14:19:39.000000000 +0000 @@ -14,7 +14,7 @@ * Classes implementing this interface may use a subsystem which requires less * memory than working with large strings of data. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_OutputByteStream { @@ -25,22 +25,22 @@ * If less bytes exist than are requested the remaining bytes are given instead. * If no bytes are remaining at all, boolean false is returned. * - * @param int $length - * - * @return string|bool + * @param int $length * * @throws Swift_IoException + * + * @return string|bool */ public function read($length); /** * Move the internal read pointer to $byteOffset in the stream. * - * @param int $byteOffset - * - * @return bool + * @param int $byteOffset * * @throws Swift_IoException + * + * @return bool */ public function setReadPointer($byteOffset); } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/AntiFloodPlugin.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/AntiFloodPlugin.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/AntiFloodPlugin.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/AntiFloodPlugin.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Reduces network flooding when sending large amounts of mail. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Plugins_AntiFloodPlugin implements Swift_Events_SendListener, Swift_Plugins_Sleeper { @@ -60,7 +60,7 @@ /** * Set the number of emails to send before restarting. * - * @param int $threshold + * @param int $threshold */ public function setThreshold($threshold) { @@ -80,7 +80,7 @@ /** * Set the number of seconds to sleep for during a restart. * - * @param int $sleep time + * @param int $sleep time */ public function setSleepTime($sleep) { @@ -128,7 +128,7 @@ /** * Sleep for $seconds. * - * @param int $seconds + * @param int $seconds */ public function sleep($seconds) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Reduces network flooding when sending large amounts of mail. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Plugins_BandwidthMonitorPlugin implements Swift_Events_SendListener, Swift_Events_CommandListener, Swift_Events_ResponseListener, Swift_InputByteStream { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Decorator/Replacements.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Decorator/Replacements.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Decorator/Replacements.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Decorator/Replacements.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Allows customization of Messages on-the-fly. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Plugins_Decorator_Replacements { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/DecoratorPlugin.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/DecoratorPlugin.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/DecoratorPlugin.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/DecoratorPlugin.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,8 +11,8 @@ /** * Allows customization of Messages on-the-fly. * - * @author Chris Corbyn - * @author Fabien Potencier + * @author Chris Corbyn + * @author Fabien Potencier */ class Swift_Plugins_DecoratorPlugin implements Swift_Events_SendListener, Swift_Plugins_Decorator_Replacements { @@ -123,7 +123,7 @@ $children = (array) $message->getChildren(); foreach ($children as $child) { - list($type, ) = sscanf($child->getContentType(), '%[^/]/%s'); + list($type) = sscanf($child->getContentType(), '%[^/]/%s'); if ('text' == $type) { $body = $child->getBody(); $bodyReplaced = str_replace( diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/ImpersonatePlugin.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/ImpersonatePlugin.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/ImpersonatePlugin.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/ImpersonatePlugin.php 2015-06-06 14:19:39.000000000 +0000 @@ -1,4 +1,5 @@ getCommand(); - $this->_logger->add(sprintf(">> %s", $command)); + $this->_logger->add(sprintf('>> %s', $command)); } /** @@ -75,7 +75,7 @@ public function responseReceived(Swift_Events_ResponseEvent $evt) { $response = $evt->getResponse(); - $this->_logger->add(sprintf("<< %s", $response)); + $this->_logger->add(sprintf('<< %s', $response)); } /** @@ -86,7 +86,7 @@ public function beforeTransportStarted(Swift_Events_TransportChangeEvent $evt) { $transportName = get_class($evt->getSource()); - $this->_logger->add(sprintf("++ Starting %s", $transportName)); + $this->_logger->add(sprintf('++ Starting %s', $transportName)); } /** @@ -97,7 +97,7 @@ public function transportStarted(Swift_Events_TransportChangeEvent $evt) { $transportName = get_class($evt->getSource()); - $this->_logger->add(sprintf("++ %s started", $transportName)); + $this->_logger->add(sprintf('++ %s started', $transportName)); } /** @@ -108,7 +108,7 @@ public function beforeTransportStopped(Swift_Events_TransportChangeEvent $evt) { $transportName = get_class($evt->getSource()); - $this->_logger->add(sprintf("++ Stopping %s", $transportName)); + $this->_logger->add(sprintf('++ Stopping %s', $transportName)); } /** @@ -119,7 +119,7 @@ public function transportStopped(Swift_Events_TransportChangeEvent $evt) { $transportName = get_class($evt->getSource()); - $this->_logger->add(sprintf("++ %s stopped", $transportName)); + $this->_logger->add(sprintf('++ %s stopped', $transportName)); } /** @@ -131,11 +131,12 @@ { $e = $evt->getException(); $message = $e->getMessage(); - $this->_logger->add(sprintf("!! %s", $message)); + $code = $e->getCode(); + $this->_logger->add(sprintf('!! %s (code: %s)', $message, $code)); $message .= PHP_EOL; $message .= 'Log data:'.PHP_EOL; $message .= $this->_logger->dump(); $evt->cancelBubble(); - throw new Swift_TransportException($message); + throw new Swift_TransportException($message, $code, $e->getPrevious()); } } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Logs to an Array backend. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Plugins_Loggers_ArrayLogger implements Swift_Plugins_Logger { @@ -32,7 +32,7 @@ /** * Create a new ArrayLogger with a maximum of $size entries. * - * @var int $size + * @var int */ public function __construct($size = 50) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Loggers/EchoLogger.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Loggers/EchoLogger.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Loggers/EchoLogger.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Loggers/EchoLogger.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Prints all log messages in real time. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Plugins_Loggers_EchoLogger implements Swift_Plugins_Logger { @@ -21,7 +21,7 @@ /** * Create a new EchoLogger. * - * @param bool $isHtml + * @param bool $isHtml */ public function __construct($isHtml = true) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/MessageLogger.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/MessageLogger.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/MessageLogger.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/MessageLogger.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Stores all sent emails for further usage. * - * @author Fabien Potencier + * @author Fabien Potencier */ class Swift_Plugins_MessageLogger implements Swift_Events_SendListener { @@ -26,7 +26,7 @@ } /** - * Get the message list + * Get the message list. * * @return array */ @@ -36,9 +36,9 @@ } /** - * Get the message count + * Get the message count. * - * @return int count + * @return int count */ public function countMessages() { @@ -46,8 +46,7 @@ } /** - * Empty the message list - * + * Empty the message list. */ public function clear() { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Pop/Pop3Connection.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Pop/Pop3Connection.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Pop/Pop3Connection.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Pop/Pop3Connection.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Pop3Connection interface for connecting and disconnecting to a POP3 host. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Plugins_Pop_Pop3Connection { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Pop/Pop3Exception.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Pop/Pop3Exception.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Pop/Pop3Exception.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Pop/Pop3Exception.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Pop3Exception thrown when an error occurs connecting to a POP3 host. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Plugins_Pop_Pop3Exception extends Swift_IoException { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/PopBeforeSmtpPlugin.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/PopBeforeSmtpPlugin.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/PopBeforeSmtpPlugin.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/PopBeforeSmtpPlugin.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Makes sure a connection to a POP3 host has been established prior to connecting to SMTP. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Plugins_PopBeforeSmtpPlugin implements Swift_Events_TransportChangeListener, Swift_Plugins_Pop_Pop3Connection { @@ -45,9 +45,9 @@ /** * Create a new PopBeforeSmtpPlugin for $host and $port. * - * @param string $host - * @param int $port - * @param string $crypto as "tls" or "ssl" + * @param string $host + * @param int $port + * @param string $crypto as "tls" or "ssl" */ public function __construct($host, $port = 110, $crypto = null) { @@ -59,9 +59,9 @@ /** * Create a new PopBeforeSmtpPlugin for $host and $port. * - * @param string $host - * @param int $port - * @param string $crypto as "tls" or "ssl" + * @param string $host + * @param int $port + * @param string $crypto as "tls" or "ssl" * * @return Swift_Plugins_PopBeforeSmtpPlugin */ @@ -97,7 +97,7 @@ /** * Set the connection timeout in seconds (default 10). * - * @param int $timeout + * @param int $timeout * * @return Swift_Plugins_PopBeforeSmtpPlugin */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/RedirectingPlugin.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/RedirectingPlugin.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/RedirectingPlugin.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/RedirectingPlugin.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Redirects all email to a single recipient. * - * @author Fabien Potencier + * @author Fabien Potencier */ class Swift_Plugins_RedirectingPlugin implements Swift_Events_SendListener { @@ -23,7 +23,7 @@ private $_recipient; /** - * List of regular expression for recipient whitelisting + * List of regular expression for recipient whitelisting. * * @var array */ @@ -33,7 +33,7 @@ * Create a new RedirectingPlugin. * * @param mixed $recipient - * @param array $whitelist + * @param array $whitelist */ public function __construct($recipient, array $whitelist = array()) { @@ -62,7 +62,7 @@ } /** - * Set a list of regular expressions to whitelist certain recipients + * Set a list of regular expressions to whitelist certain recipients. * * @param array $whitelist */ @@ -72,7 +72,7 @@ } /** - * Get the whitelist + * Get the whitelist. * * @return array */ @@ -116,7 +116,7 @@ $to = array(); } - foreach ( (array) $this->_recipient as $recipient) { + foreach ((array) $this->_recipient as $recipient) { if (!array_key_exists($recipient, $to)) { $message->addTo($recipient); } @@ -124,10 +124,10 @@ } /** - * Filter header set against a whitelist of regular expressions + * Filter header set against a whitelist of regular expressions. * * @param Swift_Mime_HeaderSet $headerSet - * @param string $type + * @param string $type */ private function _filterHeaderSet(Swift_Mime_HeaderSet $headerSet, $type) { @@ -137,9 +137,10 @@ } /** - * Filtered list of addresses => name pairs + * Filtered list of addresses => name pairs. * * @param array $recipients + * * @return array */ private function _filterNameAddresses(array $recipients) @@ -156,9 +157,10 @@ } /** - * Matches address against whitelist of regular expressions + * Matches address against whitelist of regular expressions. * * @param $recipient + * * @return bool */ protected function _isWhitelisted($recipient) diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Reporter.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Reporter.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Reporter.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Reporter.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * The Reporter plugin sends pass/fail notification to a Reporter. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Plugins_Reporter { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/ReporterPlugin.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/ReporterPlugin.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/ReporterPlugin.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/ReporterPlugin.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Does real time reporting of pass/fail for each recipient. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Plugins_ReporterPlugin implements Swift_Events_SendListener { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Reporters/HitReporter.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Reporters/HitReporter.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Reporters/HitReporter.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Reporters/HitReporter.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A reporter which "collects" failures for the Reporter plugin. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Plugins_Reporters_HitReporter implements Swift_Plugins_Reporter { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A HTML output reporter for the Reporter plugin. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Plugins_Reporters_HtmlReporter implements Swift_Plugins_Reporter { @@ -25,14 +25,14 @@ public function notify(Swift_Mime_Message $message, $address, $result) { if (self::RESULT_PASS == $result) { - echo "
".PHP_EOL; - echo "PASS ".$address.PHP_EOL; - echo "
".PHP_EOL; + echo '
'.PHP_EOL; + echo 'PASS '.$address.PHP_EOL; + echo '
'.PHP_EOL; flush(); } else { - echo "
".PHP_EOL; - echo "FAIL ".$address.PHP_EOL; - echo "
".PHP_EOL; + echo '
'.PHP_EOL; + echo 'FAIL '.$address.PHP_EOL; + echo '
'.PHP_EOL; flush(); } } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Sleeper.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Sleeper.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Sleeper.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Sleeper.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,14 +11,14 @@ /** * Sleeps for a duration of time. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Plugins_Sleeper { /** * Sleep for $seconds. * - * @param int $seconds + * @param int $seconds */ public function sleep($seconds); } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/ThrottlerPlugin.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/ThrottlerPlugin.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/ThrottlerPlugin.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/ThrottlerPlugin.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Throttles the rate at which emails are sent. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Plugins_ThrottlerPlugin extends Swift_Plugins_BandwidthMonitorPlugin implements Swift_Plugins_Sleeper, Swift_Plugins_Timer { @@ -131,7 +131,7 @@ /** * Sleep for $seconds. * - * @param int $seconds + * @param int $seconds */ public function sleep($seconds) { @@ -159,7 +159,7 @@ /** * Get a number of seconds to sleep for. * - * @param int $timePassed + * @param int $timePassed * * @return int */ @@ -187,7 +187,7 @@ /** * Get a number of seconds to sleep for. * - * @param int $timePassed + * @param int $timePassed * * @return int */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Timer.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Timer.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Plugins/Timer.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Plugins/Timer.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Provides timestamp data. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Plugins_Timer { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Preferences.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Preferences.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Preferences.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Preferences.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Changes some global preference settings in Swift Mailer. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Preferences { @@ -85,7 +85,7 @@ /** * Set the QuotedPrintable dot escaper preference. * - * @param bool $dotEscape + * @param bool $dotEscape * * @return Swift_Preferences */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/ReplacementFilterFactory.php libphp-swiftmailer-5.4.1/lib/classes/Swift/ReplacementFilterFactory.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/ReplacementFilterFactory.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/ReplacementFilterFactory.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Creates StreamFilters. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_ReplacementFilterFactory { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/RfcComplianceException.php libphp-swiftmailer-5.4.1/lib/classes/Swift/RfcComplianceException.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/RfcComplianceException.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/RfcComplianceException.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * RFC Compliance Exception class. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_RfcComplianceException extends Swift_SwiftException { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/SendmailTransport.php libphp-swiftmailer-5.4.1/lib/classes/Swift/SendmailTransport.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/SendmailTransport.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/SendmailTransport.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * SendmailTransport for sending mail through a Sendmail/Postfix (etc..) binary. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_SendmailTransport extends Swift_Transport_SendmailTransport { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/SignedMessage.php libphp-swiftmailer-5.4.1/lib/classes/Swift/SignedMessage.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/SignedMessage.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/SignedMessage.php 2015-06-06 14:19:39.000000000 +0000 @@ -15,6 +15,7 @@ * * * @author Xavier De Cock + * * @deprecated */ class Swift_SignedMessage extends Swift_Message diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Signer.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Signer.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Signer.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Signer.php 2015-06-06 14:19:39.000000000 +0000 @@ -12,7 +12,7 @@ * Base Class of Signer Infrastructure. * * - * @author Xavier De Cock + * @author Xavier De Cock */ interface Swift_Signer { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Signers/BodySigner.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Signers/BodySigner.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Signers/BodySigner.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Signers/BodySigner.php 2015-06-06 14:19:39.000000000 +0000 @@ -9,9 +9,9 @@ */ /** - * Body Signer Interface used to apply Body-Based Signature to a message + * Body Signer Interface used to apply Body-Based Signature to a message. * - * @author Xavier De Cock + * @author Xavier De Cock */ interface Swift_Signers_BodySigner extends Swift_Signer { @@ -25,7 +25,7 @@ public function signMessage(Swift_Message $message); /** - * Return the list of header a signer might tamper + * Return the list of header a signer might tamper. * * @return array */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Signers/DKIMSigner.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Signers/DKIMSigner.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Signers/DKIMSigner.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Signers/DKIMSigner.php 2015-06-06 14:19:39.000000000 +0000 @@ -9,91 +9,91 @@ */ /** - * DKIM Signer used to apply DKIM Signature to a message + * DKIM Signer used to apply DKIM Signature to a message. * - * @author Xavier De Cock + * @author Xavier De Cock */ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner { /** - * PrivateKey + * PrivateKey. * * @var string */ protected $_privateKey; /** - * DomainName + * DomainName. * * @var string */ protected $_domainName; /** - * Selector + * Selector. * * @var string */ protected $_selector; /** - * Hash algorithm used + * Hash algorithm used. * * @var string */ protected $_hashAlgorithm = 'rsa-sha1'; /** - * Body canon method + * Body canon method. * * @var string */ protected $_bodyCanon = 'simple'; /** - * Header canon method + * Header canon method. * * @var string */ protected $_headerCanon = 'simple'; /** - * Headers not being signed + * Headers not being signed. * * @var array */ protected $_ignoredHeaders = array(); /** - * Signer identity + * Signer identity. * * @var unknown_type */ protected $_signerIdentity; /** - * BodyLength + * BodyLength. * * @var int */ protected $_bodyLen = 0; /** - * Maximum signedLen + * Maximum signedLen. * * @var int */ protected $_maxLen = PHP_INT_MAX; /** - * Embbed bodyLen in signature + * Embbed bodyLen in signature. * * @var bool */ protected $_showLen = false; /** - * When the signature has been applied (true means time()), false means not embedded + * When the signature has been applied (true means time()), false means not embedded. * * @var mixed */ @@ -101,7 +101,7 @@ /** * When will the signature expires false means not embedded, if sigTimestamp is auto - * Expiration is relative, otherwhise it's absolute + * Expiration is relative, otherwhise it's absolute. * * @var int */ @@ -116,35 +116,35 @@ // work variables /** - * Headers used to generate hash + * Headers used to generate hash. * * @var array */ protected $_signedHeaders = array(); /** - * If debugHeaders is set store debugDatas here + * If debugHeaders is set store debugDatas here. * * @var string */ private $_debugHeadersData = ''; /** - * Stores the bodyHash + * Stores the bodyHash. * * @var string */ private $_bodyHash = ''; /** - * Stores the signature header + * Stores the signature header. * * @var Swift_Mime_Headers_ParameterizedHeader */ protected $_dkimHeader; /** - * Hash Handler + * Hash Handler. * * @var hash_ressource */ @@ -169,7 +169,7 @@ private $_bound = array(); /** - * Constructor + * Constructor. * * @param string $privateKey * @param string $domainName @@ -184,11 +184,12 @@ } /** - * Instanciate DKIMSigner + * Instanciate DKIMSigner. * * @param string $privateKey * @param string $domainName * @param string $selector + * * @return Swift_Signers_DKIMSigner */ public static function newInstance($privateKey, $domainName, $selector) @@ -197,7 +198,8 @@ } /** - * Reset the Signer + * Reset the Signer. + * * @see Swift_Signer::reset() */ public function reset() @@ -224,8 +226,10 @@ * second, etc etc). * * @param string $bytes - * @return int + * * @throws Swift_IoException + * + * @return int */ public function write($bytes) { @@ -296,9 +300,10 @@ } /** - * Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1 defaults to rsa-sha256 + * Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1 defaults to rsa-sha256. * * @param string $hash + * * @return Swift_Signers_DKIMSigner */ public function setHashAlgorithm($hash) @@ -314,9 +319,10 @@ } /** - * Set the body canonicalization algorithm + * Set the body canonicalization algorithm. * * @param string $canon + * * @return Swift_Signers_DKIMSigner */ public function setBodyCanon($canon) @@ -331,9 +337,10 @@ } /** - * Set the header canonicalization algorithm + * Set the header canonicalization algorithm. * * @param string $canon + * * @return Swift_Signers_DKIMSigner */ public function setHeaderCanon($canon) @@ -348,9 +355,10 @@ } /** - * Set the signer identity + * Set the signer identity. * * @param string $identity + * * @return Swift_Signers_DKIMSigner */ public function setSignerIdentity($identity) @@ -361,9 +369,10 @@ } /** - * Set the length of the body to sign + * Set the length of the body to sign. * * @param mixed $len (bool or int) + * * @return Swift_Signers_DKIMSigner */ public function setBodySignedLen($len) @@ -383,9 +392,10 @@ } /** - * Set the signature timestamp + * Set the signature timestamp. * * @param timestamp $time + * * @return Swift_Signers_DKIMSigner */ public function setSignatureTimestamp($time) @@ -396,9 +406,10 @@ } /** - * Set the signature expiration timestamp + * Set the signature expiration timestamp. * * @param timestamp $time + * * @return Swift_Signers_DKIMSigner */ public function setSignatureExpiration($time) @@ -409,9 +420,10 @@ } /** - * Enable / disable the DebugHeaders + * Enable / disable the DebugHeaders. + * + * @param bool $debug * - * @param bool $debug * @return Swift_Signers_DKIMSigner */ public function setDebugHeaders($debug) @@ -422,8 +434,7 @@ } /** - * Start Body - * + * Start Body. */ public function startBody() { @@ -440,8 +451,7 @@ } /** - * End Body - * + * End Body. */ public function endBody() { @@ -449,7 +459,7 @@ } /** - * Returns the list of Headers Tampered by this plugin + * Returns the list of Headers Tampered by this plugin. * * @return array */ @@ -463,9 +473,10 @@ } /** - * Adds an ignored Header + * Adds an ignored Header. * * @param string $header_name + * * @return Swift_Signers_DKIMSigner */ public function ignoreHeader($header_name) @@ -476,9 +487,10 @@ } /** - * Set the headers to sign + * Set the headers to sign. * * @param Swift_Mime_HeaderSet $headers + * * @return Swift_Signers_DKIMSigner */ public function setHeaders(Swift_Mime_HeaderSet $headers) @@ -488,7 +500,7 @@ $listHeaders = $headers->listAll(); foreach ($listHeaders as $hName) { // Check if we need to ignore Header - if (! isset($this->_ignoredHeaders[strtolower($hName)])) { + if (!isset($this->_ignoredHeaders[strtolower($hName)])) { if ($headers->has($hName)) { $tmp = $headers->getAll($hName); foreach ($tmp as $header) { @@ -505,9 +517,10 @@ } /** - * Add the signature to the given Headers + * Add the signature to the given Headers. * * @param Swift_Mime_HeaderSet $headers + * * @return Swift_Signers_DKIMSigner */ public function addSignature(Swift_Mime_HeaderSet $headers) @@ -552,7 +565,7 @@ if ($this->_debugHeaders) { $headers->addTextHeader('X-DebugHash', base64_encode($this->_headerHash)); } - $this->_dkimHeader->setValue($string." b=".trim(chunk_split(base64_encode($this->_getEncryptedHash()), 73, " "))); + $this->_dkimHeader->setValue($string.' b='.trim(chunk_split(base64_encode($this->_getEncryptedHash()), 73, ' '))); return $this; } @@ -566,9 +579,9 @@ // Prepare Header and cascade $exploded = explode(':', $header, 2); $name = strtolower(trim($exploded[0])); - $value = str_replace("\r\n", "", $exploded[1]); - $value = preg_replace("/[ \t][ \t]+/", " ", $value); - $header = $name.":".trim($value).($is_sig ? '' : "\r\n"); + $value = str_replace("\r\n", '', $exploded[1]); + $value = preg_replace("/[ \t][ \t]+/", ' ', $value); + $header = $name.':'.trim($value).($is_sig ? '' : "\r\n"); case 'simple' : // Nothing to do } @@ -584,7 +597,7 @@ { $len = strlen($string); $canon = ''; - $method = ($this->_bodyCanon == "relaxed"); + $method = ($this->_bodyCanon == 'relaxed'); for ($i = 0; $i < $len; ++$i) { if ($this->_bodyCanonIgnoreStart > 0) { --$this->_bodyCanonIgnoreStart; @@ -610,7 +623,7 @@ // todo handle it but should never happen } break; - case " " : + case ' ' : case "\t" : if ($method) { $this->_bodyCanonSpace = true; @@ -663,6 +676,7 @@ /** * @throws Swift_SwiftException + * * @return string */ private function _getEncryptedHash() diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Signers/DomainKeySigner.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Signers/DomainKeySigner.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Signers/DomainKeySigner.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Signers/DomainKeySigner.php 2015-06-06 14:19:39.000000000 +0000 @@ -9,56 +9,56 @@ */ /** - * DomainKey Signer used to apply DomainKeys Signature to a message + * DomainKey Signer used to apply DomainKeys Signature to a message. * - * @author Xavier De Cock + * @author Xavier De Cock */ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner { /** - * PrivateKey + * PrivateKey. * * @var string */ protected $_privateKey; /** - * DomainName + * DomainName. * * @var string */ protected $_domainName; /** - * Selector + * Selector. * * @var string */ protected $_selector; /** - * Hash algorithm used + * Hash algorithm used. * * @var string */ protected $_hashAlgorithm = 'rsa-sha1'; /** - * Canonisation method + * Canonisation method. * * @var string */ protected $_canon = 'simple'; /** - * Headers not being signed + * Headers not being signed. * * @var array */ protected $_ignoredHeaders = array(); /** - * Signer identity + * Signer identity. * * @var string */ @@ -73,21 +73,21 @@ // work variables /** - * Headers used to generate hash + * Headers used to generate hash. * * @var array */ private $_signedHeaders = array(); /** - * Stores the signature header + * Stores the signature header. * * @var Swift_Mime_Headers_ParameterizedHeader */ protected $_domainKeyHeader; /** - * Hash Handler + * Hash Handler. * * @var resource|null */ @@ -110,7 +110,7 @@ private $_bound = array(); /** - * Constructor + * Constructor. * * @param string $privateKey * @param string $domainName @@ -125,11 +125,12 @@ } /** - * Instanciate DomainKeySigner + * Instanciate DomainKeySigner. * * @param string $privateKey * @param string $domainName * @param string $selector + * * @return Swift_Signers_DomainKeySigner */ public static function newInstance($privateKey, $domainName, $selector) @@ -138,7 +139,7 @@ } /** - * Resets internal states + * Resets internal states. * * @return Swift_Signers_DomainKeysSigner */ @@ -165,8 +166,10 @@ * second, etc etc). * * @param string $bytes - * @return int + * * @throws Swift_IoException + * + * @return int * @return Swift_Signers_DomainKeysSigner */ public function write($bytes) @@ -184,6 +187,7 @@ * off the buffer. * * @throws Swift_IoException + * * @return Swift_Signers_DomainKeysSigner */ public function commit() @@ -198,6 +202,7 @@ * All {@link write()} and {@link flushBuffers()} operations will be mirrored. * * @param Swift_InputByteStream $is + * * @return Swift_Signers_DomainKeysSigner */ public function bind(Swift_InputByteStream $is) @@ -215,6 +220,7 @@ * before unbinding occurs. * * @param Swift_InputByteStream $is + * * @return Swift_Signers_DomainKeysSigner */ public function unbind(Swift_InputByteStream $is) @@ -236,6 +242,7 @@ * to the beginning. * * @throws Swift_IoException + * * @return Swift_Signers_DomainKeysSigner */ public function flushBuffers() @@ -246,9 +253,10 @@ } /** - * Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1 defaults to rsa-sha256 + * Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1 defaults to rsa-sha256. * * @param string $hash + * * @return Swift_Signers_DomainKeysSigner */ public function setHashAlgorithm($hash) @@ -259,9 +267,10 @@ } /** - * Set the canonicalization algorithm + * Set the canonicalization algorithm. * * @param string $canon simple | nofws defaults to simple + * * @return Swift_Signers_DomainKeysSigner */ public function setCanon($canon) @@ -276,9 +285,10 @@ } /** - * Set the signer identity + * Set the signer identity. * * @param string $identity + * * @return Swift_Signers_DomainKeySigner */ public function setSignerIdentity($identity) @@ -289,9 +299,10 @@ } /** - * Enable / disable the DebugHeaders + * Enable / disable the DebugHeaders. + * + * @param bool $debug * - * @param bool $debug * @return Swift_Signers_DomainKeySigner */ public function setDebugHeaders($debug) @@ -302,16 +313,14 @@ } /** - * Start Body - * + * Start Body. */ public function startBody() { } /** - * End Body - * + * End Body. */ public function endBody() { @@ -319,7 +328,7 @@ } /** - * Returns the list of Headers Tampered by this plugin + * Returns the list of Headers Tampered by this plugin. * * @return array */ @@ -333,9 +342,10 @@ } /** - * Adds an ignored Header + * Adds an ignored Header. * * @param string $header_name + * * @return Swift_Signers_DomainKeySigner */ public function ignoreHeader($header_name) @@ -346,9 +356,10 @@ } /** - * Set the headers to sign + * Set the headers to sign. * * @param Swift_Mime_HeaderSet $headers + * * @return Swift_Signers_DomainKeySigner */ public function setHeaders(Swift_Mime_HeaderSet $headers) @@ -359,7 +370,7 @@ $listHeaders = $headers->listAll(); foreach ($listHeaders as $hName) { // Check if we need to ignore Header - if (! isset($this->_ignoredHeaders[strtolower($hName)])) { + if (!isset($this->_ignoredHeaders[strtolower($hName)])) { if ($headers->has($hName)) { $tmp = $headers->getAll($hName); foreach ($tmp as $header) { @@ -377,15 +388,16 @@ } /** - * Add the signature to the given Headers + * Add the signature to the given Headers. * * @param Swift_Mime_HeaderSet $headers + * * @return Swift_Signers_DomainKeySigner */ public function addSignature(Swift_Mime_HeaderSet $headers) { // Prepare the DomainKey-Signature Header - $params = array('a' => $this->_hashAlgorithm, 'b' => chunk_split(base64_encode($this->_getEncryptedHash()), 73, " "), 'c' => $this->_canon, 'd' => $this->_domainName, 'h' => implode(': ', $this->_signedHeaders), 'q' => 'dns', 's' => $this->_selector); + $params = array('a' => $this->_hashAlgorithm, 'b' => chunk_split(base64_encode($this->_getEncryptedHash()), 73, ' '), 'c' => $this->_canon, 'd' => $this->_domainName, 'h' => implode(': ', $this->_signedHeaders), 'q' => 'dns', 's' => $this->_selector); $string = ''; foreach ($params as $k => $v) { $string .= $k.'='.$v.'; '; @@ -405,9 +417,9 @@ // Prepare Header and cascade $exploded = explode(':', $header, 2); $name = strtolower(trim($exploded[0])); - $value = str_replace("\r\n", "", $exploded[1]); - $value = preg_replace("/[ \t][ \t]+/", " ", $value); - $header = $name.":".trim($value)."\r\n"; + $value = str_replace("\r\n", '', $exploded[1]); + $value = preg_replace("/[ \t][ \t]+/", ' ', $value); + $header = $name.':'.trim($value)."\r\n"; case 'simple' : // Nothing to do } @@ -423,7 +435,7 @@ { $len = strlen($string); $canon = ''; - $nofws = ($this->_canon == "nofws"); + $nofws = ($this->_canon == 'nofws'); for ($i = 0; $i < $len; ++$i) { if ($this->_bodyCanonIgnoreStart > 0) { --$this->_bodyCanonIgnoreStart; @@ -449,7 +461,7 @@ throw new Swift_SwiftException('Invalid new line sequence in mail found \n without preceding \r'); } break; - case " " : + case ' ' : case "\t" : case "\x09": //HTAB if ($nofws) { @@ -495,6 +507,7 @@ /** * @throws Swift_SwiftException + * * @return string */ private function _getEncryptedHash() diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Signers/HeaderSigner.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Signers/HeaderSigner.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Signers/HeaderSigner.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Signers/HeaderSigner.php 2015-06-06 14:19:39.000000000 +0000 @@ -9,14 +9,14 @@ */ /** - * Header Signer Interface used to apply Header-Based Signature to a message + * Header Signer Interface used to apply Header-Based Signature to a message. * - * @author Xavier De Cock + * @author Xavier De Cock */ interface Swift_Signers_HeaderSigner extends Swift_Signer, Swift_InputByteStream { /** - * Exclude an header from the signed headers + * Exclude an header from the signed headers. * * @param string $header_name * @@ -25,21 +25,21 @@ public function ignoreHeader($header_name); /** - * Prepare the Signer to get a new Body + * Prepare the Signer to get a new Body. * * @return Swift_Signers_HeaderSigner */ public function startBody(); /** - * Give the signal that the body has finished streaming + * Give the signal that the body has finished streaming. * * @return Swift_Signers_HeaderSigner */ public function endBody(); /** - * Give the headers already given + * Give the headers already given. * * @param Swift_Mime_SimpleHeaderSet $headers * @@ -48,7 +48,7 @@ public function setHeaders(Swift_Mime_HeaderSet $headers); /** - * Add the header(s) to the headerSet + * Add the header(s) to the headerSet. * * @param Swift_Mime_HeaderSet $headers * @@ -57,7 +57,7 @@ public function addSignature(Swift_Mime_HeaderSet $headers); /** - * Return the list of header a signer might tamper + * Return the list of header a signer might tamper. * * @return array */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Signers/OpenDKIMSigner.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Signers/OpenDKIMSigner.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Signers/OpenDKIMSigner.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Signers/OpenDKIMSigner.php 2015-06-06 14:19:39.000000000 +0000 @@ -10,9 +10,9 @@ /** * DKIM Signer used to apply DKIM Signature to a message - * Takes advantage of pecl extension + * Takes advantage of pecl extension. * - * @author Xavier De Cock + * @author Xavier De Cock */ class Swift_Signers_OpenDKIMSigner extends Swift_Signers_DKIMSigner { @@ -59,7 +59,7 @@ { $bodyLen = $this->_bodyLen; if (is_bool($bodyLen)) { - $bodyLen = - 1; + $bodyLen = -1; } $hash = ($this->_hashAlgorithm == 'rsa-sha1') ? OpenDKIMSign::ALG_RSASHA1 : OpenDKIMSign::ALG_RSASHA256; $bodyCanon = ($this->_bodyCanon == 'simple') ? OpenDKIMSign::CANON_SIMPLE : OpenDKIMSign::CANON_RELAXED; @@ -81,7 +81,7 @@ $listHeaders = $headers->listAll(); foreach ($listHeaders as $hName) { // Check if we need to ignore Header - if (! isset($this->_ignoredHeaders[strtolower($hName)])) { + if (!isset($this->_ignoredHeaders[strtolower($hName)])) { $tmp = $headers->getAll($hName); if ($headers->has($hName)) { foreach ($tmp as $header) { @@ -100,7 +100,7 @@ public function startBody() { - if (! $this->_peclLoaded) { + if (!$this->_peclLoaded) { return parent::startBody(); } $this->dropFirstLF = true; @@ -111,7 +111,7 @@ public function endBody() { - if (! $this->_peclLoaded) { + if (!$this->_peclLoaded) { return parent::endBody(); } $this->_dkimHandler->eom(); @@ -128,9 +128,10 @@ } /** - * Set the signature timestamp + * Set the signature timestamp. * * @param timestamp $time + * * @return Swift_Signers_DKIMSigner */ public function setSignatureTimestamp($time) @@ -141,9 +142,10 @@ } /** - * Set the signature expiration timestamp + * Set the signature expiration timestamp. * * @param timestamp $time + * * @return Swift_Signers_DKIMSigner */ public function setSignatureExpiration($time) @@ -154,9 +156,10 @@ } /** - * Enable / disable the DebugHeaders + * Enable / disable the DebugHeaders. + * + * @param bool $debug * - * @param bool $debug * @return Swift_Signers_DKIMSigner */ public function setDebugHeaders($debug) @@ -170,7 +173,7 @@ protected function _canonicalizeBody($string) { - if (! $this->_peclLoaded) { + if (!$this->_peclLoaded) { return parent::_canonicalizeBody($string); } if (false && $this->dropFirstLF === true) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Signers/SMimeSigner.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Signers/SMimeSigner.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Signers/SMimeSigner.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Signers/SMimeSigner.php 2015-06-06 14:19:39.000000000 +0000 @@ -12,8 +12,8 @@ * MIME Message Signer used to apply S/MIME Signature/Encryption to a message. * * - * @author Romain-Geissler - * @author Sebastiaan Stok + * @author Romain-Geissler + * @author Sebastiaan Stok */ class Swift_Signers_SMimeSigner implements Swift_Signers_BodySigner { @@ -26,6 +26,7 @@ protected $signOptions; protected $encryptOptions; protected $encryptCipher; + protected $extraCerts = null; /** * @var Swift_StreamFilters_StringReplacementFilterFactory @@ -88,10 +89,11 @@ * @param string $certificate * @param string|array $privateKey If the key needs an passphrase use array('file-location', 'passphrase') instead * @param int $signOptions Bitwise operator options for openssl_pkcs7_sign() + * @param string $extraCerts A file containing intermediate certificates needed by the signing certificate * * @return Swift_Signers_SMimeSigner */ - public function setSignCertificate($certificate, $privateKey = null, $signOptions = PKCS7_DETACHED) + public function setSignCertificate($certificate, $privateKey = null, $signOptions = PKCS7_DETACHED, $extraCerts = null) { $this->signCertificate = 'file://'.str_replace('\\', '/', realpath($certificate)); @@ -105,6 +107,9 @@ } $this->signOptions = $signOptions; + if (null !== $extraCerts) { + $this->extraCerts = str_replace('\\', '/', realpath($extraCerts)); + } return $this; } @@ -229,7 +234,7 @@ /** * @param Swift_InputByteStream $inputStream - * @param Swift_Message $mimeEntity + * @param Swift_Message $mimeEntity */ protected function toSMimeByteStream(Swift_InputByteStream $inputStream, Swift_Message $message) { @@ -287,7 +292,12 @@ { $signedMessageStream = new Swift_ByteStream_TemporaryFileByteStream(); - if (!openssl_pkcs7_sign($outputStream->getPath(), $signedMessageStream->getPath(), $this->signCertificate, $this->signPrivateKey, array(), $this->signOptions)) { + $args = array($outputStream->getPath(), $signedMessageStream->getPath(), $this->signCertificate, $this->signPrivateKey, array(), $this->signOptions); + if (null !== $this->extraCerts) { + $args[] = $this->extraCerts; + } + + if (!call_user_func_array('openssl_pkcs7_sign', $args)) { throw new Swift_IoException(sprintf('Failed to sign S/Mime message. Error: "%s".', openssl_error_string())); } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/SmtpTransport.php libphp-swiftmailer-5.4.1/lib/classes/Swift/SmtpTransport.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/SmtpTransport.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/SmtpTransport.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,8 @@ /** * Sends Messages over SMTP with ESMTP support. * - * @author Chris Corbyn + * @author Chris Corbyn + * * @method Swift_SmtpTransport setUsername(string $username) Set the username to authenticate with. * @method string getUsername() Get the username to authenticate with. * @method Swift_SmtpTransport setPassword(string $password) Set the password to authenticate with. @@ -24,9 +25,9 @@ /** * Create a new SmtpTransport, optionally with $host, $port and $security. * - * @param string $host - * @param int $port - * @param string $security + * @param string $host + * @param int $port + * @param string $security */ public function __construct($host = 'localhost', $port = 25, $security = null) { @@ -44,9 +45,9 @@ /** * Create a new SmtpTransport instance. * - * @param string $host - * @param int $port - * @param string $security + * @param string $host + * @param int $port + * @param string $security * * @return Swift_SmtpTransport */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Spool.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Spool.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Spool.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Spool.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Interface for spools. * - * @author Fabien Potencier + * @author Fabien Potencier */ interface Swift_Spool { @@ -37,7 +37,7 @@ * * @param Swift_Mime_Message $message The message to store * - * @return bool Whether the operation has succeeded + * @return bool Whether the operation has succeeded */ public function queueMessage(Swift_Mime_Message $message); @@ -47,7 +47,7 @@ * @param Swift_Transport $transport A transport instance * @param string[] $failedRecipients An array of failures by-reference * - * @return int The number of sent emails + * @return int The number of sent emails */ public function flushQueue(Swift_Transport $transport, &$failedRecipients = null); } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/SpoolTransport.php libphp-swiftmailer-5.4.1/lib/classes/Swift/SpoolTransport.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/SpoolTransport.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/SpoolTransport.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Stores Messages in a queue. * - * @author Fabien Potencier + * @author Fabien Potencier */ class Swift_SpoolTransport extends Swift_Transport_SpoolTransport { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/StreamFilter.php libphp-swiftmailer-5.4.1/lib/classes/Swift/StreamFilter.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/StreamFilter.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/StreamFilter.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Processes bytes as they pass through a stream and performs filtering. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_StreamFilter { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php libphp-swiftmailer-5.4.1/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php 2015-06-06 14:19:39.000000000 +0000 @@ -13,7 +13,7 @@ * * This stream filter deals with Byte arrays rather than simple strings. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_StreamFilters_ByteArrayReplacementFilter implements Swift_StreamFilter { @@ -53,11 +53,11 @@ $last_size = $size = 0; foreach ($search as $i => $search_element) { if ($tree !== null) { - $tree[-1] = min (count($replace) - 1, $i - 1); + $tree[-1] = min(count($replace) - 1, $i - 1); $tree[-2] = $last_size; } $tree = &$this->_tree; - if (is_array ($search_element)) { + if (is_array($search_element)) { foreach ($search_element as $k => $char) { $this->_index[$char] = true; if (!isset($tree[$char])) { @@ -65,7 +65,7 @@ } $tree = &$tree[$char]; } - $last_size = $k+1; + $last_size = $k + 1; $size = max($size, $last_size); } else { $last_size = 1; @@ -78,13 +78,13 @@ } } if ($i !== null) { - $tree[-1] = min (count ($replace) - 1, $i); + $tree[-1] = min(count($replace) - 1, $i); $tree[-2] = $last_size; $this->_treeMaxLen = $size; } foreach ($replace as $rep) { if (!is_array($rep)) { - $rep = array ($rep); + $rep = array($rep); } $this->_replace[] = $rep; } @@ -105,14 +105,14 @@ { $endOfBuffer = end($buffer); - return isset ($this->_index[$endOfBuffer]); + return isset($this->_index[$endOfBuffer]); } /** * Perform the actual replacements on $buffer and return the result. * - * @param array $buffer - * @param int $_minReplaces + * @param array $buffer + * @param int $_minReplaces * * @return array */ @@ -130,10 +130,10 @@ // We try to find if the next byte is part of a search pattern for ($j = 0; $j <= $this->_treeMaxLen; ++$j) { // We have a new byte for a search pattern - if (isset ($buffer [$p = $i + $j]) && isset($search_pos[$buffer[$p]])) { + if (isset($buffer [$p = $i + $j]) && isset($search_pos[$buffer[$p]])) { $search_pos = $search_pos[$buffer[$p]]; // We have a complete pattern, save, in case we don't find a better match later - if (isset($search_pos[- 1]) && $search_pos[-1] < $last_found + if (isset($search_pos[-1]) && $search_pos[-1] < $last_found && $search_pos[-1] > $_minReplaces) { $last_found = $search_pos[-1]; $last_size = $search_pos[-2]; diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php libphp-swiftmailer-5.4.1/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Creates filters for replacing needles in a string buffer. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_StreamFilters_StringReplacementFilterFactory implements Swift_ReplacementFilterFactory { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/StreamFilters/StringReplacementFilter.php libphp-swiftmailer-5.4.1/lib/classes/Swift/StreamFilters/StringReplacementFilter.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/StreamFilters/StringReplacementFilter.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/StreamFilters/StringReplacementFilter.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Processes bytes as they pass through a buffer and replaces sequences in it. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_StreamFilters_StringReplacementFilter implements Swift_StreamFilter { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/SwiftException.php libphp-swiftmailer-5.4.1/lib/classes/Swift/SwiftException.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/SwiftException.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/SwiftException.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,17 +11,19 @@ /** * Base Exception class. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_SwiftException extends Exception { /** * Create a new SwiftException with $message. * - * @param string $message + * @param string $message + * @param int $code + * @param Exception $previous */ - public function __construct($message) + public function __construct($message, $code = 0, Exception $previous = null) { - parent::__construct($message); + parent::__construct($message, $code, $previous); } } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/AbstractSmtpTransport.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/AbstractSmtpTransport.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/AbstractSmtpTransport.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/AbstractSmtpTransport.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Sends Messages over SMTP. * - * @author Chris Corbyn + * @author Chris Corbyn */ abstract class Swift_Transport_AbstractSmtpTransport implements Swift_Transport { @@ -87,7 +87,7 @@ } /** - * Returns the IP used to connect to the destination + * Returns the IP used to connect to the destination. * * @return string */ @@ -159,9 +159,10 @@ } if (!$reversePath = $this->_getReversePath($message)) { - throw new Swift_TransportException( + $this->_throwException(new Swift_TransportException( 'Cannot send message without a sender address' - ); + ) + ); } $to = (array) $message->getTo(); @@ -300,7 +301,7 @@ protected function _doMailFromCommand($address) { $this->executeCommand( - sprintf("MAIL FROM: <%s>\r\n", $address), array(250) + sprintf("MAIL FROM:<%s>\r\n", $address), array(250) ); } @@ -308,7 +309,7 @@ protected function _doRcptToCommand($address) { $this->executeCommand( - sprintf("RCPT TO: <%s>\r\n", $address), array(250, 251, 252) + sprintf("RCPT TO:<%s>\r\n", $address), array(250, 251, 252) ); } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Handles CRAM-MD5 authentication. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Transport_Esmtp_Auth_CramMd5Authenticator implements Swift_Transport_Esmtp_Authenticator { @@ -73,7 +73,7 @@ $k_ipad = substr($secret, 0, 64) ^ str_repeat(chr(0x36), 64); $k_opad = substr($secret, 0, 64) ^ str_repeat(chr(0x5C), 64); - $inner = pack('H32', md5($k_ipad.$challenge)); + $inner = pack('H32', md5($k_ipad.$challenge)); $digest = md5($k_opad.$inner); return $digest; diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Handles LOGIN authentication. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Transport_Esmtp_Auth_LoginAuthenticator implements Swift_Transport_Esmtp_Authenticator { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php 2015-06-06 14:19:39.000000000 +0000 @@ -13,12 +13,12 @@ /** * Handles NTLM authentication. * - * @author Ward Peeters + * @author Ward Peeters */ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Esmtp_Authenticator { const NTLMSIG = "NTLMSSP\x00"; - const DESCONST = "KGS!@#$%"; + const DESCONST = 'KGS!@#$%'; /** * Get the name of the AUTH mechanism this Authenticator handles. @@ -34,8 +34,8 @@ * Try to authenticate the user with $username and $password. * * @param Swift_Transport_SmtpAgent $agent - * @param string $username - * @param string $password + * @param string $username + * @param string $password * * @return bool */ @@ -59,7 +59,7 @@ $response = base64_decode(substr(trim($this->sendMessage1($agent)), 4)); // extra parameters for our unit cases - $timestamp = func_num_args() > 3 ? func_get_arg(3) : $this->getCorrectTimestamp(bcmul(microtime(true), "1000")); + $timestamp = func_num_args() > 3 ? func_get_arg(3) : $this->getCorrectTimestamp(bcmul(microtime(true), '1000')); $client = func_num_args() > 4 ? func_get_arg(4) : $this->getRandomBytes(8); // Message 3 response @@ -83,7 +83,7 @@ // pad to $bits bit $bin_length = strlen($bin); if ($bin_length < $bits) { - $bin = str_repeat("0", $bits - $bin_length).$bin; + $bin = str_repeat('0', $bits - $bin_length).$bin; } } else { // negative @@ -91,7 +91,7 @@ $bin = base_convert($si, 10, 2); $bin_length = strlen($bin); if ($bin_length > $bits) { - $bin = str_repeat("1", $bits - $bin_length).$bin; + $bin = str_repeat('1', $bits - $bin_length).$bin; } } } @@ -100,9 +100,10 @@ } /** - * Send our auth message and returns the response + * Send our auth message and returns the response. * * @param Swift_Transport_SmtpAgent $agent + * * @return string SMTP Response */ protected function sendMessage1(Swift_Transport_SmtpAgent $agent) @@ -113,9 +114,10 @@ } /** - * Fetch all details of our response (message 2) + * Fetch all details of our response (message 2). * * @param string $response + * * @return array our response parsed */ protected function parseMessage2($response) @@ -146,9 +148,10 @@ } /** - * Read the blob information in from message2 + * Read the blob information in from message2. * * @param $block + * * @return array */ protected function readSubBlock($block) @@ -177,15 +180,16 @@ } /** - * Send our final message with all our data + * Send our final message with all our data. * - * @param string $response Message 1 response (message 2) - * @param string $username - * @param string $password - * @param string $timestamp - * @param string $client + * @param string $response Message 1 response (message 2) + * @param string $username + * @param string $password + * @param string $timestamp + * @param string $client * @param Swift_Transport_SmtpAgent $agent - * @param bool $v2 Use version2 of the protocol + * @param bool $v2 Use version2 of the protocol + * * @return string */ protected function sendMessage3($response, $username, $password, $timestamp, $client, Swift_Transport_SmtpAgent $agent, $v2 = true) @@ -212,7 +216,7 @@ } /** - * Create our message 1 + * Create our message 1. * * @return string */ @@ -224,13 +228,14 @@ } /** - * Create our message 3 + * Create our message 3. * * @param string $domain * @param string $username * @param string $workstation * @param string $lmResponse * @param string $ntlmResponse + * * @return string */ protected function createMessage3($domain, $username, $workstation, $lmResponse, $ntlmResponse) @@ -253,7 +258,7 @@ .$domainSec // Domain header .$userSec // User header .$workSec // Workstation header -.$this->createByte("000000009a", 8) // session key header (empty) +.$this->createByte('000000009a', 8) // session key header (empty) .$this->createByte('01020000') // FLAGS .$this->convertTo16bit($domain) // domain name .$this->convertTo16bit($username) // username @@ -263,9 +268,10 @@ } /** - * @param string $timestamp Epoch timestamp in microseconds - * @param string $client Random bytes + * @param string $timestamp Epoch timestamp in microseconds + * @param string $client Random bytes * @param string $targetInfo + * * @return string */ protected function createBlob($timestamp, $client, $targetInfo) @@ -280,11 +286,12 @@ } /** - * Get domain and username from our username + * Get domain and username from our username. * * @example DOMAIN\username * * @param string $name + * * @return array */ protected function getDomainAndUsername($name) @@ -299,10 +306,11 @@ } /** - * Create LMv1 response + * Create LMv1 response. * * @param string $password * @param string $challenge + * * @return string */ protected function createLMPassword($password, $challenge) @@ -327,10 +335,11 @@ } /** - * Create NTLMv1 response + * Create NTLMv1 response. * * @param string $password * @param string $challenge + * * @return string */ protected function createNTLMPassword($password, $challenge) @@ -347,9 +356,10 @@ } /** - * Convert a normal timestamp to a tenth of a microtime epoch time + * Convert a normal timestamp to a tenth of a microtime epoch time. * * @param string $time + * * @return string */ protected function getCorrectTimestamp($time) @@ -358,11 +368,11 @@ bcscale(0); $time = number_format($time, 0, '.', ''); // save microtime to string - $time = bcadd($time, "11644473600000"); // add epoch time + $time = bcadd($time, '11644473600000'); // add epoch time $time = bcmul($time, 10000); // tenths of a microsecond. $binary = $this->si2bin($time, 64); // create 64 bit binary string - $timestamp = ""; + $timestamp = ''; for ($i = 0; $i < 8; $i++) { $timestamp .= chr(bindec(substr($binary, -(($i + 1) * 8), 8))); } @@ -371,13 +381,14 @@ } /** - * Create LMv2 response + * Create LMv2 response. * * @param string $password * @param string $username * @param string $domain * @param string $challenge NTLM Challenge - * @param string $client Random string + * @param string $client Random string + * * @return string */ protected function createLMv2Password($password, $username, $domain, $challenge, $client) @@ -395,16 +406,18 @@ } /** - * Create NTLMv2 response + * Create NTLMv2 response. * * @param string $password * @param string $username * @param string $domain - * @param string $challenge Hex values + * @param string $challenge Hex values * @param string $targetInfo Hex values * @param string $timestamp - * @param string $client Random bytes + * @param string $client Random bytes + * * @return string + * * @see http://davenport.sourceforge.net/ntlm.html#theNtlmResponse */ protected function createNTLMv2Hash($password, $username, $domain, $challenge, $targetInfo, $timestamp, $client) @@ -451,11 +464,12 @@ /** HELPER FUNCTIONS */ /** - * Create our security buffer depending on length and offset + * Create our security buffer depending on length and offset. + * + * @param string $value Value we want to put in + * @param int $offset start of value + * @param bool $is16 Do we 16bit string or not? * - * @param string $value Value we want to put in - * @param int $offset start of value - * @param bool $is16 Do we 16bit string or not? * @return string */ protected function createSecurityBuffer($value, $offset, $is16 = false) @@ -468,9 +482,10 @@ } /** - * Read our security buffer to fetch length and offset of our value + * Read our security buffer to fetch length and offset of our value. * * @param string $value Securitybuffer in hex + * * @return array array with length and offset */ protected function readSecurityBuffer($value) @@ -482,9 +497,10 @@ } /** - * Cast to byte java equivalent to (byte) + * Cast to byte java equivalent to (byte). * * @param int $v + * * @return int */ protected function castToByte($v) @@ -494,10 +510,11 @@ /** * Java unsigned right bitwise - * $a >>> $b + * $a >>> $b. * * @param int $a * @param int $b + * * @return int */ protected function uRShift($a, $b) @@ -510,11 +527,12 @@ } /** - * Right padding with 0 to certain length + * Right padding with 0 to certain length. * * @param string $input - * @param int $bytes Length of bytes - * @param bool $isHex Did we provided hex value + * @param int $bytes Length of bytes + * @param bool $isHex Did we provided hex value + * * @return string */ protected function createByte($input, $bytes = 4, $isHex = true) @@ -529,9 +547,10 @@ } /** - * Create random bytes + * Create random bytes. * * @param $length + * * @return string */ protected function getRandomBytes($length) @@ -547,10 +566,11 @@ /** ENCRYPTION ALGORITHMS */ /** - * DES Encryption + * DES Encryption. * * @param string $value * @param string $key + * * @return string */ protected function desEncrypt($value, $key) @@ -562,10 +582,11 @@ } /** - * MD5 Encryption + * MD5 Encryption. * * @param string $key Encryption key * @param string $msg Message to encrypt + * * @return string */ protected function md5Encrypt($key, $msg) @@ -583,10 +604,12 @@ } /** - * MD4 Encryption + * MD4 Encryption. * * @param string $input + * * @return string + * * @see http://php.net/manual/en/ref.hash.php */ protected function md4Encrypt($input) @@ -597,9 +620,10 @@ } /** - * Convert UTF-8 to UTF-16 + * Convert UTF-8 to UTF-16. * * @param string $input + * * @return string */ protected function convertTo16bit($input) @@ -608,8 +632,10 @@ } /** - * Hex2bin replacement for < PHP 5.4 + * Hex2bin replacement for < PHP 5.4. + * * @param string $hex + * * @return string Binary */ protected function hex2bin($hex) @@ -631,7 +657,7 @@ echo substr($message, 0, 16)." NTLMSSP Signature
\n"; echo $messageId." Type Indicator
\n"; - if ($messageId == "02000000") { + if ($messageId == '02000000') { $map = array( 'Challenge', 'Context', @@ -650,7 +676,7 @@ foreach ($map as $key => $value) { echo bin2hex($data[$key]).' - '.$data[$key].' ||| '.$value."
\n"; } - } elseif ($messageId == "03000000") { + } elseif ($messageId == '03000000') { $i = 0; $data[$i++] = substr($message, 24, 16); list($lmLength, $lmOffset) = $this->readSecurityBuffer($data[$i - 1]); @@ -695,6 +721,6 @@ } } - echo "

"; + echo '

'; } } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Handles PLAIN authentication. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Transport_Esmtp_Auth_PlainAuthenticator implements Swift_Transport_Esmtp_Authenticator { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/Esmtp/Auth/XOAuth2Authenticator.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/Esmtp/Auth/XOAuth2Authenticator.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/Esmtp/Auth/XOAuth2Authenticator.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/Esmtp/Auth/XOAuth2Authenticator.php 2015-06-06 14:19:39.000000000 +0000 @@ -19,7 +19,8 @@ * ->setPassword('YOUR_ACCESS_TOKEN'); * * - * @author xu.li + * @author xu.li + * * @see https://developers.google.com/google-apps/gmail/xoauth2_protocol */ class Swift_Transport_Esmtp_Auth_XOAuth2Authenticator implements Swift_Transport_Esmtp_Authenticator @@ -47,7 +48,7 @@ { try { $param = $this->constructXOAuth2Params($email, $token); - $agent->executeCommand("AUTH XOAUTH2 ".$param."\r\n", array(235)); + $agent->executeCommand('AUTH XOAUTH2 '.$param."\r\n", array(235)); return true; } catch (Swift_TransportException $e) { @@ -58,7 +59,7 @@ } /** - * Construct the auth parameter + * Construct the auth parameter. * * @see https://developers.google.com/google-apps/gmail/xoauth2_protocol#the_sasl_xoauth2_mechanism */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/Esmtp/Authenticator.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/Esmtp/Authenticator.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/Esmtp/Authenticator.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/Esmtp/Authenticator.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * An Authentication mechanism. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Transport_Esmtp_Authenticator { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/Esmtp/AuthHandler.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/Esmtp/AuthHandler.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/Esmtp/AuthHandler.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/Esmtp/AuthHandler.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * An ESMTP handler for AUTH support. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Transport_Esmtp_AuthHandler implements Swift_Transport_EsmtpHandler { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/EsmtpHandler.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/EsmtpHandler.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/EsmtpHandler.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/EsmtpHandler.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * An ESMTP handler. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Transport_EsmtpHandler { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/EsmtpTransport.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/EsmtpTransport.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/EsmtpTransport.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/EsmtpTransport.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Sends Messages over SMTP with ESMTP support. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTransport implements Swift_Transport_SmtpAgent { @@ -84,7 +84,7 @@ /** * Set the port to connect to. * - * @param int $port + * @param int $port * * @return Swift_Transport_EsmtpTransport */ @@ -108,7 +108,7 @@ /** * Set the connection timeout. * - * @param int $timeout seconds + * @param int $timeout seconds * * @return Swift_Transport_EsmtpTransport */ @@ -131,7 +131,7 @@ } /** - * Set the encryption type (tls or ssl) + * Set the encryption type (tls or ssl). * * @param string $encryption * @@ -181,7 +181,7 @@ */ public function getSourceIp() { - return $this->_params['sourceIp']; + return isset($this->_params['sourceIp']) ? $this->_params['sourceIp'] : null; } /** @@ -318,7 +318,7 @@ } $paramStr = !empty($params) ? ' '.implode(' ', $params) : ''; $this->executeCommand( - sprintf("MAIL FROM: <%s>%s\r\n", $address, $paramStr), array(250) + sprintf("MAIL FROM:<%s>%s\r\n", $address, $paramStr), array(250) ); } @@ -332,7 +332,7 @@ } $paramStr = !empty($params) ? ' '.implode(' ', $params) : ''; $this->executeCommand( - sprintf("RCPT TO: <%s>%s\r\n", $address, $paramStr), array(250, 251, 252) + sprintf("RCPT TO:<%s>%s\r\n", $address, $paramStr), array(250, 251, 252) ); } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/FailoverTransport.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/FailoverTransport.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/FailoverTransport.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/FailoverTransport.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Contains a list of redundant Transports so when one fails, the next is used. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Transport_FailoverTransport extends Swift_Transport_LoadBalancedTransport { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/IoBuffer.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/IoBuffer.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/IoBuffer.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/IoBuffer.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Buffers input and output to a resource. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Transport_IoBuffer extends Swift_InputByteStream, Swift_OutputByteStream { @@ -59,7 +59,7 @@ * The $sequence number comes from any writes and may or may not be used * depending upon the implementation. * - * @param int $sequence of last write to scan from + * @param int $sequence of last write to scan from * * @return string */ diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/LoadBalancedTransport.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/LoadBalancedTransport.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/LoadBalancedTransport.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/LoadBalancedTransport.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Redundantly and rotationally uses several Transports when sending. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Transport_LoadBalancedTransport implements Swift_Transport { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/MailTransport.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/MailTransport.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/MailTransport.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/MailTransport.php 2015-06-06 14:19:39.000000000 +0000 @@ -19,7 +19,7 @@ * due to limitations of PHP's internal mail() function. You'll get an * all-or-nothing result from sending. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Transport_MailTransport implements Swift_Transport { @@ -126,9 +126,7 @@ $subjectHeader = $message->getHeaders()->get('Subject'); if (!$toHeader) { - throw new Swift_TransportException( - 'Cannot send message without a recipient' - ); + $this->_throwException(new Swift_TransportException('Cannot send message without a recipient')); } $to = $toHeader->getFieldBody(); $subject = $subjectHeader ? $subjectHeader->getFieldBody() : ''; @@ -204,6 +202,19 @@ $this->_eventDispatcher->bindEventListener($plugin); } + /** Throw a TransportException, first sending it to any listeners */ + protected function _throwException(Swift_TransportException $e) + { + if ($evt = $this->_eventDispatcher->createTransportExceptionEvent($this, $e)) { + $this->_eventDispatcher->dispatchEvent($evt, 'exceptionThrown'); + if (!$evt->bubbleCancelled()) { + throw $e; + } + } else { + throw $e; + } + } + /** Determine the best-use reverse path for this message */ private function _getReversePath(Swift_Mime_Message $message) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/NullTransport.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/NullTransport.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/NullTransport.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/NullTransport.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Pretends messages have been sent, but just ignores them. * - * @author Fabien Potencier + * @author Fabien Potencier */ class Swift_Transport_NullTransport implements Swift_Transport { @@ -56,7 +56,7 @@ * @param Swift_Mime_Message $message * @param string[] $failedRecipients An array of failures by-reference * - * @return int The number of sent emails + * @return int The number of sent emails */ public function send(Swift_Mime_Message $message, &$failedRecipients = null) { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/SendmailTransport.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/SendmailTransport.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/SendmailTransport.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/SendmailTransport.php 2015-06-06 14:19:39.000000000 +0000 @@ -15,7 +15,7 @@ * It is advised to use -bs mode since error reporting with -t mode is not * possible. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Transport_SendmailTransport extends Swift_Transport_AbstractSmtpTransport { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/SmtpAgent.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/SmtpAgent.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/SmtpAgent.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/SmtpAgent.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Wraps an IoBuffer to send/receive SMTP commands/responses. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Transport_SmtpAgent { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/SpoolTransport.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/SpoolTransport.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/SpoolTransport.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/SpoolTransport.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Stores Messages in a queue. * - * @author Fabien Potencier + * @author Fabien Potencier */ class Swift_Transport_SpoolTransport implements Swift_Transport { @@ -84,7 +84,7 @@ * @param Swift_Mime_Message $message * @param string[] $failedRecipients An array of failures by-reference * - * @return int The number of sent e-mail's + * @return int The number of sent e-mail's */ public function send(Swift_Mime_Message $message, &$failedRecipients = null) { @@ -98,7 +98,7 @@ $success = $this->_spool->queueMessage($message); if ($evt) { - $evt->setResult($success ? Swift_Events_SendEvent::RESULT_SUCCESS : Swift_Events_SendEvent::RESULT_FAILED); + $evt->setResult($success ? Swift_Events_SendEvent::RESULT_SPOOLED : Swift_Events_SendEvent::RESULT_FAILED); $this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed'); } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/StreamBuffer.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/StreamBuffer.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport/StreamBuffer.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport/StreamBuffer.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * A generic IoBuffer implementation supporting remote sockets and local processes. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_Transport_StreamBuffer extends Swift_ByteStream_AbstractFilterableInputStream implements Swift_Transport_IoBuffer { @@ -151,11 +151,11 @@ * The $sequence number comes from any writes and may or may not be used * depending upon the implementation. * - * @param int $sequence of last write to scan from - * - * @return string + * @param int $sequence of last write to scan from * * @throws Swift_IoException + * + * @return string */ public function readLine($sequence) { @@ -183,11 +183,11 @@ * If less bytes exist than are requested the remaining bytes are given instead. * If no bytes are remaining at all, boolean false is returned. * - * @param int $length - * - * @return string|bool + * @param int $length * * @throws Swift_IoException + * + * @return string|bool */ public function read($length) { @@ -273,8 +273,8 @@ stream_set_blocking($this->_stream, 0); } stream_set_timeout($this->_stream, $timeout); - $this->_in = & $this->_stream; - $this->_out = & $this->_stream; + $this->_in = &$this->_stream; + $this->_out = &$this->_stream; } /** @@ -295,8 +295,8 @@ 'Process could not be started ['.$err.']' ); } - $this->_in = & $pipes[0]; - $this->_out = & $pipes[1]; + $this->_in = &$pipes[0]; + $this->_out = &$pipes[1]; } private function _getReadConnectionDescription() diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/TransportException.php libphp-swiftmailer-5.4.1/lib/classes/Swift/TransportException.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/TransportException.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/TransportException.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,17 +11,19 @@ /** * TransportException thrown when an error occurs in the Transport subsystem. * - * @author Chris Corbyn + * @author Chris Corbyn */ class Swift_TransportException extends Swift_IoException { /** * Create a new TransportException with $message. * - * @param string $message + * @param string $message + * @param int $code + * @param Exception $previous */ - public function __construct($message) + public function __construct($message, $code = 0, Exception $previous = null) { - parent::__construct($message); + parent::__construct($message, $code, $previous); } } diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Transport.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Transport.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,7 +11,7 @@ /** * Sends Messages via an abstract Transport subsystem. * - * @author Chris Corbyn + * @author Chris Corbyn */ interface Swift_Transport { diff -Nru libphp-swiftmailer-5.2.2/lib/classes/Swift/Validate.php libphp-swiftmailer-5.4.1/lib/classes/Swift/Validate.php --- libphp-swiftmailer-5.2.2/lib/classes/Swift/Validate.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/lib/classes/Swift/Validate.php 2015-06-06 14:19:39.000000000 +0000 @@ -1,4 +1,5 @@ 'application/x-php', + 'php' => 'application/x-php', 'php3' => 'application/x-php', 'php4' => 'application/x-php', 'php5' => 'application/x-php', - 'zip' => 'application/zip', - 'gif' => 'image/gif', - 'png' => 'image/png', - 'css' => 'text/css', - 'js' => 'text/javascript', - 'txt' => 'text/plain', - 'xml' => 'text/xml', - 'aif' => 'audio/x-aiff', + 'zip' => 'application/zip', + 'gif' => 'image/gif', + 'png' => 'image/png', + 'css' => 'text/css', + 'js' => 'text/javascript', + 'txt' => 'text/plain', + 'aif' => 'audio/x-aiff', 'aiff' => 'audio/x-aiff', - 'avi' => 'video/avi', - 'bmp' => 'image/bmp', - 'bz2' => 'application/x-bz2', - 'csv' => 'text/csv', - 'dmg' => 'application/x-apple-diskimage', - 'doc' => 'application/msword', + 'avi' => 'video/avi', + 'bmp' => 'image/bmp', + 'bz2' => 'application/x-bz2', + 'csv' => 'text/csv', + 'dmg' => 'application/x-apple-diskimage', + 'doc' => 'application/msword', 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'eml' => 'message/rfc822', - 'aps' => 'application/postscript', - 'exe' => 'application/x-ms-dos-executable', - 'flv' => 'video/x-flv', - 'gz' => 'application/x-gzip', - 'hqx' => 'application/stuffit', - 'htm' => 'text/html', + 'eml' => 'message/rfc822', + 'aps' => 'application/postscript', + 'exe' => 'application/x-ms-dos-executable', + 'flv' => 'video/x-flv', + 'gz' => 'application/x-gzip', + 'hqx' => 'application/stuffit', + 'htm' => 'text/html', 'html' => 'text/html', - 'jar' => 'application/x-java-archive', + 'jar' => 'application/x-java-archive', 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'm3u' => 'audio/x-mpegurl', - 'm4a' => 'audio/mp4', - 'mdb' => 'application/x-msaccess', - 'mid' => 'audio/midi', + 'jpg' => 'image/jpeg', + 'm3u' => 'audio/x-mpegurl', + 'm4a' => 'audio/mp4', + 'mdb' => 'application/x-msaccess', + 'mid' => 'audio/midi', 'midi' => 'audio/midi', - 'mov' => 'video/quicktime', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', + 'mov' => 'video/quicktime', + 'mp3' => 'audio/mpeg', + 'mp4' => 'video/mp4', 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'odg' => 'vnd.oasis.opendocument.graphics', - 'odp' => 'vnd.oasis.opendocument.presentation', - 'odt' => 'vnd.oasis.opendocument.text', - 'ods' => 'vnd.oasis.opendocument.spreadsheet', - 'ogg' => 'audio/ogg', - 'pdf' => 'application/pdf', - 'ppt' => 'application/vnd.ms-powerpoint', + 'mpg' => 'video/mpeg', + 'odg' => 'vnd.oasis.opendocument.graphics', + 'odp' => 'vnd.oasis.opendocument.presentation', + 'odt' => 'vnd.oasis.opendocument.text', + 'ods' => 'vnd.oasis.opendocument.spreadsheet', + 'ogg' => 'audio/ogg', + 'pdf' => 'application/pdf', + 'ppt' => 'application/vnd.ms-powerpoint', 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'ps' => 'application/postscript', - 'rar' => 'application/x-rar-compressed', - 'rtf' => 'application/rtf', - 'tar' => 'application/x-tar', - 'sit' => 'application/x-stuffit', - 'svg' => 'image/svg+xml', - 'tif' => 'image/tiff', + 'ps' => 'application/postscript', + 'rar' => 'application/x-rar-compressed', + 'rtf' => 'application/rtf', + 'tar' => 'application/x-tar', + 'sit' => 'application/x-stuffit', + 'svg' => 'image/svg+xml', + 'tif' => 'image/tiff', 'tiff' => 'image/tiff', - 'ttf' => 'application/x-font-truetype', - 'vcf' => 'text/x-vcard', - 'wav' => 'audio/wav', - 'wma' => 'audio/x-ms-wma', - 'wmv' => 'audio/x-ms-wmv', - 'xls' => 'application/excel', + 'ttf' => 'application/x-font-truetype', + 'vcf' => 'text/x-vcard', + 'wav' => 'audio/wav', + 'wma' => 'audio/x-ms-wma', + 'wmv' => 'audio/x-ms-wmv', + 'xls' => 'application/excel', 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xml' => 'application/xml', + 'xml' => 'application/xml', ); // wrap array for generating file @@ -110,7 +109,7 @@ // all extensions from second match foreach ($matches[2] as $i => $extensions) { // explode multiple extensions from string - $extensions = explode(" ", strtolower($extensions)); + $extensions = explode(' ', strtolower($extensions)); // force array for foreach if (!is_array($extensions)) { @@ -139,14 +138,14 @@ foreach ($xml as $node) { // check if there is no pattern - if (!isset($node->glob["pattern"])) { + if (!isset($node->glob['pattern'])) { continue; } // get all matching extensions from match - foreach ((array) $node->glob["pattern"] as $extension) { + foreach ((array) $node->glob['pattern'] as $extension) { // skip none glob extensions - if (strpos($extension, '.') === FALSE) { + if (strpos($extension, '.') === false) { continue; } @@ -160,15 +159,15 @@ } } - if (isset($node->glob["pattern"][0])) { + if (isset($node->glob['pattern'][0])) { // mime type - $mime_type = strtolower((string) $node["type"]); + $mime_type = strtolower((string) $node['type']); // get first extension - $extension = strtolower(trim($node->glob["ddpattern"][0], '*.')); + $extension = strtolower(trim($node->glob['ddpattern'][0], '*.')); // skip none glob extensions and check if string length between 1 and 10 - if (strpos($extension, '.') !== FALSE || strlen($extension) < 1 || strlen($extension) > 9) { + if (strpos($extension, '.') !== false || strlen($extension) < 1 || strlen($extension) > 9) { continue; } diff -Nru libphp-swiftmailer-5.2.2/notes/APPS libphp-swiftmailer-5.4.1/notes/APPS --- libphp-swiftmailer-5.2.2/notes/APPS 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/notes/APPS 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -Applications I need to test with ---------------------------------- - -Standalone (can read .eml files): ---------------------------------- -Microsoft Entourage (can assume same as outlook) -Mozilla Thunderbird -Apple Mail - -Web-based: ----------- -Hotmail -Gmail -Yahoo! -Mail2Web diff -Nru libphp-swiftmailer-5.2.2/notes/CHARSETS libphp-swiftmailer-5.4.1/notes/CHARSETS --- libphp-swiftmailer-5.2.2/notes/CHARSETS 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/notes/CHARSETS 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -Following is a list of character sets along with their widths: --------------------------------------------------------------- - -1 Octet 8bit: -------------- -Windows 125* (CP125*) -CP* -ANSI -ISO-8859-* (IEC-8859-*) -Macintosh (Mac OS Roman) -KOI8-U (potentially KOI*8-*) -KOI8-R -MIK -Cork (T1) -ISCII -VISCII - - -1 Octet 7bit: -------------- -US-ASCII -K0I7 - -2 octets 16 bit: ----------------- -UCS-2 -UTF-16* (UTF-16BE etc) - -4-octets 32 bit: ----------------- -UCS-4 -UTF-32 - -Variable-width: ----------------------------- -Big5 - http://en.wikipedia.org/wiki/Big5 (1-2 bytes: 00-7f=1, 81-fe=2) -HKSCS - http://en.wikipedia.org/wiki/HKSCS (a big5 variant, but some variants use 10646) -ISO-10646 (IEC-10646) - http://en.wikipedia.org/wiki/ISO_10646 (unicode) -UTF-8 (1-5 bytes) -ISO-2022 (IEC-2022) - http://en.wikipedia.org/wiki/ISO_2022 -Shift-JIS - http://en.wikipedia.org/wiki/Shift-JIS - -A good resource: ----------------- -http://en.wikipedia.org/wiki/Character_encoding#Simple_character_sets - diff -Nru libphp-swiftmailer-5.2.2/notes/message.xml libphp-swiftmailer-5.4.1/notes/message.xml --- libphp-swiftmailer-5.2.2/notes/message.xml 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/notes/message.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ - - - Some test message - chris@w3style.co.uk - mark@swiftmailer.org - chris.corbyn@sitepoint.com - text/plain - - Here's a recipe for beef stifado - - - text/html - - This is the other part - - - - application/pdf - stifado.pdf - /path/to/stifado.pdf - - diff -Nru libphp-swiftmailer-5.2.2/notes/smtp.txt libphp-swiftmailer-5.4.1/notes/smtp.txt --- libphp-swiftmailer-5.2.2/notes/smtp.txt 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/notes/smtp.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -General Notes --------------- - * MX is NOT required, but an A record, or CNAME to a MX MUST be present at the least. - * EHLO should be tried, then fall back to HELO - * The 250 return code from RCPT TO is not actually clear-cut. A 251 may be - returned if the message was forwarded to another address. This could be a - useful indicator to end-users that an address should be updated. - * RCPT TO can accpet just "postmaster" without a domain name - * Server MUST not close connection before: - - QUIT and returning 221 response - - Forced requirement, and only after returning a 421 response - - Clients expriencing a forced connection closure, without prior warning should - just treat it like a 451 closure regardless - * ALWAYS use blocking sockets for the initial connection (this should prevent - Exim4's whining about sync). - -Response codes --------------- - * From RFC2821, 4.2. - - In particular, the 220, 221, 251, 421, and 551 reply codes - are associated with message text that must be parsed and interpreted - by machines. - -Error Codes ------------- - * Numeric 5yz = Error - - 550/RCPT TO = Relay denied - - 500 = Unknown command - * Numeric 2yz = Normal - * Numeric 4yz = Temporary failure?? - -assertEquals('7bit', $encoder->getName()); + } + + public function testGet8BitEncodingReturns8BitEncoder() + { + $encoder = Swift_Encoding::get8BitEncoding(); + $this->assertEquals('8bit', $encoder->getName()); + } + + public function testGetQpEncodingReturnsQpEncoder() + { + $encoder = Swift_Encoding::getQpEncoding(); + $this->assertEquals('quoted-printable', $encoder->getName()); + } + + public function testGetBase64EncodingReturnsBase64Encoder() + { + $encoder = Swift_Encoding::getBase64Encoding(); + $this->assertEquals('base64', $encoder->getName()); + } +} diff -Nru libphp-swiftmailer-5.2.2/tests/acceptance/Swift/MessageAcceptanceTest.php libphp-swiftmailer-5.4.1/tests/acceptance/Swift/MessageAcceptanceTest.php --- libphp-swiftmailer-5.2.2/tests/acceptance/Swift/MessageAcceptanceTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/acceptance/Swift/MessageAcceptanceTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -10,7 +10,7 @@ $message = $this->_createMessage(); $message->setSubject('just a test subject'); $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn',)); + 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); $id = $message->getId(); $date = $message->getDate(); diff -Nru libphp-swiftmailer-5.2.2/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php libphp-swiftmailer-5.4.1/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php --- libphp-swiftmailer-5.2.2/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -13,7 +13,7 @@ { if (function_exists('mb_convert_encoding')) { // base64_encode and split cannot handle long JIS text to fold - $subject = "長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い件名"; + $subject = '長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い件名'; $encodedWrapperLength = strlen('=?iso-2022-jp?'.$this->_encoder->getName().'??='); diff -Nru libphp-swiftmailer-5.2.2/tests/acceptance/Swift/Mime/SimpleMessageAcceptanceTest.php libphp-swiftmailer-5.4.1/tests/acceptance/Swift/Mime/SimpleMessageAcceptanceTest.php --- libphp-swiftmailer-5.2.2/tests/acceptance/Swift/Mime/SimpleMessageAcceptanceTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/acceptance/Swift/Mime/SimpleMessageAcceptanceTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -227,7 +227,7 @@ $message->setReturnPath('chris@w3style.co.uk'); $message->setSubject('just a test subject'); $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn',)); + 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); $id = $message->getId(); $date = $message->getDate(); $this->assertEquals( @@ -249,7 +249,7 @@ $message->setReturnPath(''); $message->setSubject('just a test subject'); $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn',)); + 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); $id = $message->getId(); $date = $message->getDate(); $this->assertEquals( @@ -547,7 +547,7 @@ $message->setReturnPath('chris@w3style.co.uk'); $message->setSubject('just a test subject'); $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn',)); + 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); $message->setBody( 'just a test body'."\r\n". 'with a new line' @@ -576,7 +576,7 @@ $message->setReturnPath('chris@w3style.co.uk'); $message->setSubject('just a test subject'); $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn',)); + 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); $message->setBody( 'Just s'.pack('C*', 0xC2, 0x01, 0x01).'me multi-'."\r\n". 'line message!' @@ -605,7 +605,7 @@ $message->setReturnPath('chris@w3style.co.uk'); $message->setSubject('just a test subject'); $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn',)); + 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); $id = $message->getId(); $date = $message->getDate(); @@ -658,7 +658,7 @@ $message->setReturnPath('chris@w3style.co.uk'); $message->setSubject('just a test subject'); $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn',)); + 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); $id = $message->getId(); $date = preg_quote(date('r', $message->getDate()), '~'); @@ -720,7 +720,7 @@ $message->setReturnPath('chris@w3style.co.uk'); $message->setSubject('just a test subject'); $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn',)); + 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); $id = $message->getId(); $date = preg_quote(date('r', $message->getDate()), '~'); @@ -806,7 +806,7 @@ $message->setReturnPath('chris@w3style.co.uk'); $message->setSubject('just a test subject'); $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn',)); + 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); $id = $message->getId(); $date = preg_quote(date('r', $message->getDate()), '~'); @@ -883,7 +883,7 @@ $message->setReturnPath('chris@w3style.co.uk'); $message->setSubject('just a test subject'); $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn',)); + 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); $id = $message->getId(); $date = preg_quote(date('r', $message->getDate()), '~'); @@ -958,7 +958,7 @@ $message->setReturnPath('chris@w3style.co.uk'); $message->setSubject('just a test subject'); $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn',)); + 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); $id = $message->getId(); $date = $message->getDate(); @@ -1001,7 +1001,7 @@ $message->setReturnPath('chris@w3style.co.uk'); $message->setSubject('just a test subject'); $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn',)); + 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); $message->setCharset('utf-8'); $message->setFormat('flowed'); $message->setDelSp(true); @@ -1057,7 +1057,7 @@ $message->setReturnPath('chris@w3style.co.uk'); $message->setSubject('just a test subject'); $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn',)); + 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); $message->setContentType('text/html'); $message->setCharset('iso-8859-1'); $message->setBody('foo'); @@ -1107,7 +1107,7 @@ $message->setReturnPath('chris@w3style.co.uk'); $message->setSubject('just a test subject'); $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn',)); + 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); $id = $message->getId(); $date = date('r', $message->getDate()); @@ -1157,7 +1157,7 @@ $message->setReturnPath('chris@w3style.co.uk'); $message->setSubject('just a test subject'); $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn',)); + 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); $message->setContentType('text/html'); $message->setBody('foo'); @@ -1204,7 +1204,7 @@ $message->setReturnPath('chris@w3style.co.uk'); $message->setSubject('just a test subject'); $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn',)); + 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); $message->setBody( 'just a test body'."\n". 'with a new line' diff -Nru libphp-swiftmailer-5.2.2/tests/acceptance/Swift/Transport/StreamBuffer/SocketTimeoutTest.php libphp-swiftmailer-5.4.1/tests/acceptance/Swift/Transport/StreamBuffer/SocketTimeoutTest.php --- libphp-swiftmailer-5.2.2/tests/acceptance/Swift/Transport/StreamBuffer/SocketTimeoutTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/acceptance/Swift/Transport/StreamBuffer/SocketTimeoutTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -16,8 +16,8 @@ } $serverStarted = false; - for ($i = 0; $i<5; ++$i) { - $this->_randomHighPort = rand(50000,65000); + for ($i = 0; $i < 5; ++$i) { + $this->_randomHighPort = rand(50000, 65000); $this->_server = stream_socket_server('tcp://127.0.0.1:'.$this->_randomHighPort); if ($this->_server) { $serverStarted = true; diff -Nru libphp-swiftmailer-5.2.2/tests/bootstrap.php libphp-swiftmailer-5.4.1/tests/bootstrap.php --- libphp-swiftmailer-5.2.2/tests/bootstrap.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/bootstrap.php 2015-06-06 14:19:39.000000000 +0000 @@ -1,6 +1,7 @@ add('Swift_', __DIR__.'/unit'); set_include_path(get_include_path().PATH_SEPARATOR.dirname(__DIR__).'/lib'); diff -Nru libphp-swiftmailer-5.2.2/tests/bug/Swift/Bug534Test.php libphp-swiftmailer-5.4.1/tests/bug/Swift/Bug534Test.php --- libphp-swiftmailer-5.2.2/tests/bug/Swift/Bug534Test.php 1970-01-01 00:00:00.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/bug/Swift/Bug534Test.php 2015-06-06 14:19:39.000000000 +0000 @@ -0,0 +1,38 @@ +setFrom('from@example.com') + ->setTo('to@example.com') + ->setSubject('test') + ; + $cid = $message->embed(Swift_Image::fromPath(__DIR__.'/../../_samples/files/swiftmailer.png')); + $message->setBody('', 'text/html'); + + $that = $this; + $messageValidation = function (Swift_Mime_Message $message) use ($that) { + preg_match('/cid:(.*)"/', $message->toString(), $matches); + $cid = $matches[1]; + preg_match('/Content-ID: <(.*)>/', $message->toString(), $matches); + $contentId = $matches[1]; + $that->assertEquals($cid, $contentId, 'cid in body and mime part Content-ID differ'); + + return true; + }; + + $failedRecipients = array(); + + $transport = m::mock('Swift_Transport'); + $transport->shouldReceive('isStarted')->andReturn(true); + $transport->shouldReceive('send')->with(m::on($messageValidation), $failedRecipients)->andReturn(1); + + $memorySpool = new Swift_MemorySpool(); + $memorySpool->queueMessage($message); + $memorySpool->flushQueue($transport, $failedRecipients); + } +} diff -Nru libphp-swiftmailer-5.2.2/tests/fixtures/MimeEntityFixture.php libphp-swiftmailer-5.4.1/tests/fixtures/MimeEntityFixture.php --- libphp-swiftmailer-5.2.2/tests/fixtures/MimeEntityFixture.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/fixtures/MimeEntityFixture.php 2015-06-06 14:19:39.000000000 +0000 @@ -29,13 +29,31 @@ } // These methods are here to account for the implemented interfaces - public function getId() {} - public function getHeaders() {} - public function getBody() {} - public function setBody($body, $contentType = null) {} - public function toByteStream(Swift_InputByteStream $is) {} - public function charsetChanged($charset) {} - public function encoderChanged(Swift_Mime_ContentEncoder $encoder) {} - public function getChildren() {} - public function setChildren(array $children) {} + public function getId() + { + } + public function getHeaders() + { + } + public function getBody() + { + } + public function setBody($body, $contentType = null) + { + } + public function toByteStream(Swift_InputByteStream $is) + { + } + public function charsetChanged($charset) + { + } + public function encoderChanged(Swift_Mime_ContentEncoder $encoder) + { + } + public function getChildren() + { + } + public function setChildren(array $children) + { + } } diff -Nru libphp-swiftmailer-5.2.2/tests/IdenticalBinaryConstraint.php libphp-swiftmailer-5.4.1/tests/IdenticalBinaryConstraint.php --- libphp-swiftmailer-5.2.2/tests/IdenticalBinaryConstraint.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/IdenticalBinaryConstraint.php 2015-06-06 14:19:39.000000000 +0000 @@ -2,6 +2,7 @@ /** * A binary safe string comparison. + * * @author Chris Corbyn */ class IdenticalBinaryConstraint extends \PHPUnit_Framework_Constraint @@ -18,6 +19,7 @@ * constraint is met, FALSE otherwise. * * @param mixed $other Value or object to evaluate. + * * @return bool */ public function matches($other) @@ -41,7 +43,7 @@ /** * Get the given string of bytes as a stirng of Hexadecimal sequences. * - * @param string $binary + * @param string $binary * * @return string */ Binary files /tmp/0eTvNPXOt3/libphp-swiftmailer-5.2.2/tests/_samples/files/swiftmailer.png and /tmp/tmTQNEv1Fd/libphp-swiftmailer-5.4.1/tests/_samples/files/swiftmailer.png differ diff -Nru libphp-swiftmailer-5.2.2/tests/_samples/smime/create-cert.sh libphp-swiftmailer-5.4.1/tests/_samples/smime/create-cert.sh --- libphp-swiftmailer-5.2.2/tests/_samples/smime/create-cert.sh 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/_samples/smime/create-cert.sh 2015-06-06 14:19:39.000000000 +0000 @@ -11,6 +11,20 @@ rm sign.csr +openssl genrsa -out intermediate.key 2048 +openssl req -new -key intermediate.key -subj '/CN=Swiftmailer Intermediate/O=Swiftmailer/L=Paris/C=FR' -out intermediate.csr +openssl x509 -req -in intermediate.csr -CA CA.crt -CAkey CA.key -set_serial 01 -out intermediate.crt -days 1460 +openssl x509 -in intermediate.crt -clrtrust -out intermediate.crt + +rm intermediate.csr + +openssl genrsa -out sign2.key 2048 +openssl req -new -key sign2.key -subj '/CN=Swiftmailer-User2/O=Swiftmailer/L=Paris/C=FR' -out sign2.csr +openssl x509 -req -in sign2.csr -CA intermediate.crt -CAkey intermediate.key -set_serial 01 -out sign2.crt -days 1460 -addtrust emailProtection +openssl x509 -in sign2.crt -clrtrust -out sign2.crt + +rm sign2.csr + openssl genrsa -out encrypt.key 2048 openssl req -new -key encrypt.key -subj '/CN=Swiftmailer-User/O=Swiftmailer/L=Paris/C=FR' -out encrypt.csr openssl x509 -req -in encrypt.csr -CA CA.crt -CAkey CA.key -CAcreateserial -out encrypt.crt -days 1460 -addtrust emailProtection diff -Nru libphp-swiftmailer-5.2.2/tests/_samples/smime/intermediate.crt libphp-swiftmailer-5.4.1/tests/_samples/smime/intermediate.crt --- libphp-swiftmailer-5.2.2/tests/_samples/smime/intermediate.crt 1970-01-01 00:00:00.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/_samples/smime/intermediate.crt 2015-06-06 14:19:39.000000000 +0000 @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDFjCCAf4CAQEwDQYJKoZIhvcNAQEFBQAwTDEXMBUGA1UEAwwOU3dpZnRtYWls +ZXIgQ0ExFDASBgNVBAoMC1N3aWZ0bWFpbGVyMQ4wDAYDVQQHDAVQYXJpczELMAkG +A1UEBhMCRlIwHhcNMTQxMTIwMTMyNTQxWhcNMTgxMTE5MTMyNTQxWjBWMSEwHwYD +VQQDDBhTd2lmdG1haWxlciBJbnRlcm1lZGlhdGUxFDASBgNVBAoMC1N3aWZ0bWFp +bGVyMQ4wDAYDVQQHDAVQYXJpczELMAkGA1UEBhMCRlIwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDSgEhftX6f1wV+uqWl4J+zwCn8fHaLZT6GZ0Gs9ThE +4e+4mkLG1rvSEIJon8U0ic8Zph1UGa1Grveh5bgbldHlFxYSsCCyDGgixRvRWNhI +KuO+SxaIZChqqKwVn3aNQ4BZOSo/MjJ/jQyr9BMgMmdxlHR3e1wkkeAkW//sOsfu +xQGF1h9yeQvuu/GbG6K7vHSGOGd5O3G7bftfQ7l78TMqeJ7jV32AdJeuO5MD4dRn +W4CQLTaeribLN0MKn35UdSiFoZxKHqqWcgtl5xcJWPOmq6CsAJ2Eo90kW/BHOrLv +10h6Oan9R1PdXSvSCvVnXY3Kz30zofw305oA/KJk/hVzAgMBAAEwDQYJKoZIhvcN +AQEFBQADggEBABijZ2NNd05Js5VFNr4uyaydam9Yqu/nnrxbPRbAXPlCduydu2Gd +d1ekn3nblMJ87Bc7zVyHdAQD8/AfS1LOKuoWHpTzmlpIL+8T5sbCYG5J1jKdeLkh +7L/UD5v1ACgA33oKtN8GzcrIq8Zp73r0n+c3hFCfDYRSZRCxGyIf3qgU2LBOD0A3 +wTff/N8E/p3WaJX9VnuQ7xyRMOubDuqJnlo5YsFv7wjyGOIAz9afZzcEbH6czt/t +g0Xc/kGr/fkAjUu+z3ZfE4247Gut5m3hEVwWkpEEzQo4osX/BEX20Q2nPz9WBq4a +pK3qNNGwAqS4gdE3ihOExMWxAKgr9d2CcU4= +-----END CERTIFICATE----- diff -Nru libphp-swiftmailer-5.2.2/tests/_samples/smime/intermediate.key libphp-swiftmailer-5.4.1/tests/_samples/smime/intermediate.key --- libphp-swiftmailer-5.2.2/tests/_samples/smime/intermediate.key 1970-01-01 00:00:00.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/_samples/smime/intermediate.key 2015-06-06 14:19:39.000000000 +0000 @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEA0oBIX7V+n9cFfrqlpeCfs8Ap/Hx2i2U+hmdBrPU4ROHvuJpC +xta70hCCaJ/FNInPGaYdVBmtRq73oeW4G5XR5RcWErAgsgxoIsUb0VjYSCrjvksW +iGQoaqisFZ92jUOAWTkqPzIyf40Mq/QTIDJncZR0d3tcJJHgJFv/7DrH7sUBhdYf +cnkL7rvxmxuiu7x0hjhneTtxu237X0O5e/EzKnie41d9gHSXrjuTA+HUZ1uAkC02 +nq4myzdDCp9+VHUohaGcSh6qlnILZecXCVjzpqugrACdhKPdJFvwRzqy79dIejmp +/UdT3V0r0gr1Z12Nys99M6H8N9OaAPyiZP4VcwIDAQABAoIBAQDLJiKyu2XIvKsA +8wCKZY262+mpUjTVso/1BhHL6Zy0XZgMgFORsgrxYB16+zZGzfiguD/1uhIP9Svn +gtt7Q8udW/phbrkfG/okFDYUg7m3bCz+qVjFqGOZC8+Hzq2LB2oGsbSj6L3zexyP +lq4elIZghvUfml4CrQW0EVWbld79/kF7XHABcIOk2+3f63XAQWkjdFNxj5+z6TR0 +52Rv7SmRioAsukW9wr77G3Luv/0cEzDFXgGW5s0wO+rJg28smlsIaj+Y0KsptTig +reQvReAT/S5ZxEp4H6WtXQ1WmaliMB0Gcu4TKB0yE8DoTeCePuslo9DqGokXYT66 +oqtcVMqBAoGBAPoOL9byNNU/bBNDWSCiq8PqhSjl0M4vYBGqtgMXM4GFOJU+W2nX +YRJbbxoSd/DKjnxEsR6V0vDTDHj4ZSkgmpEmVhEdAiwUwaZ0T8YUaCPhdiAENo5+ +zRBWVJcvAC2XKTK1hy5D7Z5vlC32HHygYqitU+JsK4ylvhrdeOcGx5cfAoGBANeB +X0JbeuqBEwwEHZqYSpzmtB+IEiuYc9ARTttHEvIWgCThK4ldAzbXhDUIQy3Hm0sL +PzDA33furNl2WwB+vmOuioYMNjArKrfg689Aim1byg4AHM5XVQcqoDSOABtI55iP +E0hYDe/d4ema2gk1uR/mT4pnLnk2VzRKsHUbP9stAoGBAKjyIuJwPMADnMqbC0Hg +hnrVHejW9TAJlDf7hgQqjdMppmQ3gF3PdjeH7VXJOp5GzOQrKRxIEABEJ74n3Xlf +HO+K3kWrusb7syb6mNd0/DOZ5kyVbCL0iypJmdeXmuAyrFQlj9LzdD1Cl/RBv1d4 +qY/bo7xsZzQc24edMU2uJ/XzAoGBAMHChA95iK5HlwR6vtM8kfk4REMFaLDhxV8R +8MCeyp33NQfzm91JT5aDd07nOt9yVGHInuwKveFrKuXq0C9FxZCCYfHcEOyGI0Zo +aBxTfyKMIMMtvriXNM/Yt2oJMndVuUUlfsTQxtcfu/r5S4h0URopTOK3msVI4mcV +sEnaUjORAoGAGDnslKYtROQMXTe4sh6CoJ32J8UZVV9M+8NLus9rO0v/eZ/pIFxo +MXGrrrl51ScqahCQ+DXHzpLvInsdlAJvDP3ymhb7H2xGsyvb3x2YgsLmr1YVOnli +ISbCssno3vZyFU1TDjeEIKqZHc92byHNMjMuhmlaA25g8kb0cCO76EA= +-----END RSA PRIVATE KEY----- diff -Nru libphp-swiftmailer-5.2.2/tests/_samples/smime/sign2.crt libphp-swiftmailer-5.4.1/tests/_samples/smime/sign2.crt --- libphp-swiftmailer-5.2.2/tests/_samples/smime/sign2.crt 1970-01-01 00:00:00.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/_samples/smime/sign2.crt 2015-06-06 14:19:39.000000000 +0000 @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDGTCCAgECAQEwDQYJKoZIhvcNAQEFBQAwVjEhMB8GA1UEAwwYU3dpZnRtYWls +ZXIgSW50ZXJtZWRpYXRlMRQwEgYDVQQKDAtTd2lmdG1haWxlcjEOMAwGA1UEBwwF +UGFyaXMxCzAJBgNVBAYTAkZSMB4XDTE0MTEyMDEzMjYyNloXDTE4MTExOTEzMjYy +NlowTzEaMBgGA1UEAwwRU3dpZnRtYWlsZXItVXNlcjIxFDASBgNVBAoMC1N3aWZ0 +bWFpbGVyMQ4wDAYDVQQHDAVQYXJpczELMAkGA1UEBhMCRlIwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQDbr1m4z/rzFS/DxUUQIhKNx19oAeGYLt3niaEP +twfvBMNB80gMgM9d+XtqrPAMPeY/2C8t5NlChNPKMcR70JBKdmlSH4/aTjaIfWmD +PoZJjvRRXINZgSHNKIt4ZGAN/EPFr19CBisV4iPxzu+lyIbbkaZJ/qtyatlP7m/q +8TnykFRlyxNEveCakpcXeRd3YTFGKWoED+/URhVc0cCPZVjoeSTtPHAYBnC29lG5 +VFbq6NBQiyF4tpjOHRarq6G8PtQFH9CpAZg5bPk3bqka9C8mEr5jWfrM4EHtUkTl +CwVLOQRBsz/nMBT27pXZh18GU0hc3geNDN4kqaeqgNBo0mblAgMBAAEwDQYJKoZI +hvcNAQEFBQADggEBAAHDMuv6oxWPsTQWWGWWFIk7QZu3iogMqFuxhhQxg8BE37CT +Vt1mBVEjYGMkWhMSwWBMWuP6yuOZecWtpp6eOie/UKGg1XoW7Y7zq2aQaP7YPug0 +8Lgq1jIo7iO2b6gZeMtLiTZrxyte0z1XzS3wy7ZC9mZjYd7QE7mZ+/rzQ0x5zjOp +G8b3msS/yYYJCMN+HtHln++HOGmm6uhvbsHTfvvZvtl7F5vJ5WhGGlUfjhanSEtZ +1RKx+cbgIv1eFOGO1OTuZfEuKdLb0T38d/rjLeI99nVVKEIGtLmX4dj327GHe/D3 +aPr2blF2gOvlzkfN9Vz6ZUE2s3rVBeCg2AVseYQ= +-----END CERTIFICATE----- diff -Nru libphp-swiftmailer-5.2.2/tests/_samples/smime/sign2.key libphp-swiftmailer-5.4.1/tests/_samples/smime/sign2.key --- libphp-swiftmailer-5.2.2/tests/_samples/smime/sign2.key 1970-01-01 00:00:00.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/_samples/smime/sign2.key 2015-06-06 14:19:39.000000000 +0000 @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA269ZuM/68xUvw8VFECISjcdfaAHhmC7d54mhD7cH7wTDQfNI +DIDPXfl7aqzwDD3mP9gvLeTZQoTTyjHEe9CQSnZpUh+P2k42iH1pgz6GSY70UVyD +WYEhzSiLeGRgDfxDxa9fQgYrFeIj8c7vpciG25GmSf6rcmrZT+5v6vE58pBUZcsT +RL3gmpKXF3kXd2ExRilqBA/v1EYVXNHAj2VY6Hkk7TxwGAZwtvZRuVRW6ujQUIsh +eLaYzh0Wq6uhvD7UBR/QqQGYOWz5N26pGvQvJhK+Y1n6zOBB7VJE5QsFSzkEQbM/ +5zAU9u6V2YdfBlNIXN4HjQzeJKmnqoDQaNJm5QIDAQABAoIBAAM2FvuqnqJ7Bs23 +zoCj3t2PsodUr7WHydqemmoeZNFLoocORVlZcK6Q/QrcKE4lgX4hbN8g30QnqOjl +vVeJ/vH3tSZsK7AnQIjSPH6cpV3h5xRhY9IlHxdepltGLFlH/L2hCKVwbaTOP3RD +cCFeQwpmoKWoQV1UzoRqmdw3Vn+DMaUULomLVR9aSW9PnKeFL+tPWShf7GmVISfM +2H6xKw/qT0XAX59ZHA1laxSFVvbV5ZcKrBOFMV407Vzw2d3ojmfEzNsHjUVBXX8j +B5nK1VeJiTVmcoVhnRX7tXESDaZy+Kv38pqOmc8Svn70lDJ35SM2EpWnX39w5LsQ +29NsIUECgYEA/vNKiMfVmmZNQrpcuHQe5adlmz9+I4xJ4wbRzrS7czpbKF0/iaPf +dKoVz67yYHOJCBHTVaXWkElQsq1mkyuFt/cc0ReJXO8709+t+6ULsE50cLQm/HN5 +npg3gw0Ls/9dy/cHM5SdVIHMBm9oQ65rXup/dqWC8Dz2cAAOQhIPwx0CgYEA3Jbk +DPdUlrj4sXcE3V/CtmBuK9Xq1xolJt026fYCrle0YhdMKmchRBDCc6BzM+F/vDyC +llPfQu8TDXK40Oan7GbxMdoLqKK9gSIq1dvfG1YMMz8OrBcX8xKe61KFRWd7QSBJ +BcY575NzYHapOHVGnUJ68j8zCow0gfb7q6iK4GkCgYEAz2mUuKSCxYL21hORfUqT +HFjMU7oa38axEa6pn9XvLjZKlRMPruWP1HTPG9ADRa6Yy+TcnrA1V9sdeM+TRKXC +usCiRAU27lF+xccS30gNs1iQaGRX10gGqJzDhK1nWP+nClmlFTSRrn+OQan/FBjh +Jy31lsveM54VC1cwQlY5Vo0CgYEArtjfnLNzFiE55xjq/znHUd4vlYlzItrzddHE +lEBOsbiNH29ODRI/2P7b0uDsT8Q/BoqEC/ohLqHn3TIA8nzRv91880HdGecdBL17 +bJZiSv2yn/AshhWsAxzQYMDBKFk05lNb7jrIc3DR9DU6PqketsoaP+f+Yi7t89I8 +fD0VD3kCgYAaJCoQshng/ijiHF/RJXLrXXHJSUmaOfbweX/mzFup0YR1LxUjcv85 +cxvwc41Y2iI5MwUXyX97/GYKeoobzWZy3XflNWtg04rcInVaPsb/OOFDDqI+MkzT +B4PcCurOmjzcxHMVE34CYvl3YVwWrPb5JO1rYG9T2gKUJnLU6qG4Bw== +-----END RSA PRIVATE KEY----- diff -Nru libphp-swiftmailer-5.2.2/tests/SwiftMailerSmokeTestCase.php libphp-swiftmailer-5.4.1/tests/SwiftMailerSmokeTestCase.php --- libphp-swiftmailer-5.2.2/tests/SwiftMailerSmokeTestCase.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/SwiftMailerSmokeTestCase.php 2015-06-06 14:19:39.000000000 +0000 @@ -3,7 +3,7 @@ /** * Base test for smoke tests. * - * @author Rouven Weßling + * @author Rouven Weßling */ class SwiftMailerSmokeTestCase extends SwiftMailerTestCase { @@ -38,7 +38,7 @@ $transport = Swift_DependencyContainer::getInstance()->lookup('transport.mail'); break; default: - throw new Exception('Undefined transport [' . SWIFT_SMOKE_TRANSPORT_TYPE . ']'); + throw new Exception('Undefined transport ['.SWIFT_SMOKE_TRANSPORT_TYPE.']'); } return new Swift_Mailer($transport); diff -Nru libphp-swiftmailer-5.2.2/tests/SwiftMailerTestCase.php libphp-swiftmailer-5.4.1/tests/SwiftMailerTestCase.php --- libphp-swiftmailer-5.2.2/tests/SwiftMailerTestCase.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/SwiftMailerTestCase.php 2015-06-06 14:19:39.000000000 +0000 @@ -2,7 +2,8 @@ /** * A base test case with some custom expectations. - * @author Rouven Weßling + * + * @author Rouven Weßling */ class SwiftMailerTestCase extends \PHPUnit_Framework_TestCase { diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/CharacterReader/Utf8ReaderTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/CharacterReader/Utf8ReaderTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/CharacterReader/Utf8ReaderTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/CharacterReader/Utf8ReaderTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -49,7 +49,7 @@ { for ($octet = 0xF8; $octet <= 0xFB; ++$octet) { $this->assertSame( - 4, $this->_reader->validateByteSequence(array($octet),1) + 4, $this->_reader->validateByteSequence(array($octet), 1) ); } } @@ -58,7 +58,7 @@ { for ($octet = 0xFC; $octet <= 0xFD; ++$octet) { $this->assertSame( - 5, $this->_reader->validateByteSequence(array($octet),1) + 5, $this->_reader->validateByteSequence(array($octet), 1) ); } } diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Encoder/Base64EncoderTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Encoder/Base64EncoderTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Encoder/Base64EncoderTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Encoder/Base64EncoderTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -80,7 +80,7 @@ } for ($i = 0; $i < 30; ++$i) { - $input = pack('C*', rand(0, 255), rand(0, 255), rand(0, 255)); + $input = pack('C*', rand(0, 255), rand(0, 255), rand(0, 255)); $this->assertRegExp( '~^[a-zA-Z0-9/\+]{4}$~', $this->_encoder->encodeString($input), '%s: Three bytes should have no padding' diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/MessageTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/MessageTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/MessageTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/MessageTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -11,6 +11,19 @@ $this->_recursiveObjectCloningCheck($message1, $message2, $message1_clone); } + public function testCloningWithSigners() + { + $message1 = new Swift_Message('subj', 'body', 'ctype'); + $signer = new Swift_Signers_DKIMSigner(dirname(dirname(__DIR__)).'/_samples/dkim/dkim.test.priv', 'test.example', 'example'); + $message1->attachSigner($signer); + $message2 = new Swift_Message('subj', 'body', 'ctype'); + $signer = new Swift_Signers_DKIMSigner(dirname(dirname(__DIR__)).'/_samples/dkim/dkim.test.priv', 'test.example', 'example'); + $message2->attachSigner($signer); + $message1_clone = clone $message1; + + $this->_recursiveObjectCloningCheck($message1, $message2, $message1_clone); + } + public function testBodySwap() { $message1 = new Swift_Message('Test'); @@ -36,6 +49,8 @@ } $id_1 = $message1->getId(); $id_2 = $message2->getId(); + $this->assertEquals($id_1, $id_2, 'Message Ids differ'); + $id_2 = $message2->generateId(); $this->assertNotEquals($id_1, $id_2, 'Message Ids are the same'); } @@ -69,6 +84,46 @@ } // recurse $this->_recursiveObjectCloningCheck($obj1_value, $obj2_value, $obj1_clone_value); + } elseif (is_array($value)) { + $obj1_value = $obj1_properties[$property]; + $obj2_value = $obj2_properties[$property]; + $obj1_clone_value = $obj1_clone_properties[$property]; + + return $this->_recursiveArrayCloningCheck($obj1_value, $obj2_value, $obj1_clone_value); + } + } + } + + protected function _recursiveArrayCloningCheck($array1, $array2, $array1_clone) + { + foreach ($array1 as $key => $value) { + if (is_object($value)) { + $arr1_value = $array1[$key]; + $arr2_value = $array2[$key]; + $arr1_clone_value = $array1_clone[$key]; + if ($arr1_value !== $arr2_value) { + // two separetely instanciated objects property not referencing same object + $this->assertFalse( + // but object's clone does - not everything copied + $arr1_value === $arr1_clone_value, + "Key `$key` cloning error: source and cloned objects property is referencing same object" + ); + } else { + // two separetely instanciated objects have same reference + $this->assertFalse( + // but object's clone doesn't - overdone making copies + $arr1_value !== $arr1_clone_value, + "Key `$key` not properly cloned: it should reference same object as cloning source (overdone copping)" + ); + } + // recurse + $this->_recursiveObjectCloningCheck($arr1_value, $arr2_value, $arr1_clone_value); + } elseif (is_array($value)) { + $arr1_value = $array1[$key]; + $arr2_value = $array2[$key]; + $arr1_clone_value = $array1_clone[$key]; + + return $this->_recursiveArrayCloningCheck($obj1_value, $obj2_value, $obj1_clone_value); } } } diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Mime/AbstractMimeEntityTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Mime/AbstractMimeEntityTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Mime/AbstractMimeEntityTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Mime/AbstractMimeEntityTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -255,7 +255,7 @@ $entity = $this->_createEntity($this->_createHeaderSet(), $encoder, $this->_createCache() ); - $entity->setBody("blah"); + $entity->setBody('blah'); $entity->toString(); } @@ -269,7 +269,7 @@ $entity = $this->_createEntity($this->_createHeaderSet(), $encoder, $this->_createCache() ); - $entity->setBody("blah"); + $entity->setBody('blah'); $entity->setMaxLineLength(65); $entity->toString(); } @@ -324,18 +324,18 @@ public function testGetBodyReturnsStringFromByteStream() { - $os = $this->_createOutputStream("byte stream string"); + $os = $this->_createOutputStream('byte stream string'); $entity = $this->_createEntity($this->_createHeaderSet(), $this->_createEncoder(), $this->_createCache() ); $entity->setBody($os); - $this->assertEquals("byte stream string", $entity->getBody()); + $this->assertEquals('byte stream string', $entity->getBody()); } public function testByteStreamBodyIsAppended() { $headers = $this->_createHeaderSet(array(), false); - $os = $this->_createOutputStream("streamed"); + $os = $this->_createOutputStream('streamed'); $headers->shouldReceive('toString') ->once() ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); @@ -347,7 +347,7 @@ $this->assertEquals( "Content-Type: text/plain; charset=utf-8\r\n". "\r\n". - "streamed", + 'streamed', $entity->toString() ); } @@ -426,7 +426,7 @@ ->zeroOrMoreTimes(); $entity = $this->_createEntity($this->_createHeaderSet(array( - 'Content-Type' => $cType,)), + 'Content-Type' => $cType, )), $this->_createEncoder(), $this->_createCache() ); $entity->setChildren(array($child)); @@ -448,7 +448,7 @@ ->zeroOrMoreTimes(); $entity = $this->_createEntity($this->_createHeaderSet(array( - 'Content-Type' => $cType,)), + 'Content-Type' => $cType, )), $this->_createEncoder(), $this->_createCache() ); $entity->setChildren(array($child)); @@ -470,7 +470,7 @@ ->zeroOrMoreTimes(); $entity = $this->_createEntity($this->_createHeaderSet(array( - 'Content-Type' => $cType,)), + 'Content-Type' => $cType, )), $this->_createEncoder(), $this->_createCache() ); $entity->setChildren(array($child)); @@ -479,7 +479,7 @@ public function testHighestLevelChildDeterminesContentType() { - $combinations = array( + $combinations = array( array('levels' => array(Swift_Mime_MimeEntity::LEVEL_MIXED, Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, Swift_Mime_MimeEntity::LEVEL_RELATED, @@ -540,13 +540,13 @@ $child1 = new MimeEntityFixture(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, "Content-Type: text/plain\r\n". "\r\n". - "foobar" + 'foobar' ); $child2 = new MimeEntityFixture(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, "Content-Type: text/html\r\n". "\r\n". - "foobar" + 'foobar' ); $headers->shouldReceive('toString') @@ -583,13 +583,13 @@ $part = $this->_createChild(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, "Content-Type: text/plain\r\n". "\r\n". - "foobar" + 'foobar' ); $attachment = $this->_createChild(Swift_Mime_MimeEntity::LEVEL_MIXED, "Content-Type: application/octet-stream\r\n". "\r\n". - "data" + 'data' ); $headers->shouldReceive('toString') @@ -609,19 +609,19 @@ $entity->setChildren(array($part, $attachment)); $this->assertRegExp( - "~^". + '~^'. "Content-Type: multipart/mixed; boundary=\"xxx\"\r\n". "\r\n\r\n--xxx\r\n". "Content-Type: multipart/alternative; boundary=\"yyy\"\r\n". "\r\n\r\n--(.*?)\r\n". "Content-Type: text/plain\r\n". "\r\n". - "foobar". + 'foobar'. "\r\n\r\n--\\1--\r\n". "\r\n\r\n--xxx\r\n". "Content-Type: application/octet-stream\r\n". "\r\n". - "data". + 'data'. "\r\n\r\n--xxx--\r\n". "\$~", $entity->toString() @@ -705,13 +705,13 @@ $htmlChild = new MimeEntityFixture(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, "Content-Type: text/html\r\n". "\r\n". - "HTML PART", + 'HTML PART', 'text/html' ); $textChild = new MimeEntityFixture(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, "Content-Type: text/plain\r\n". "\r\n". - "TEXT PART", + 'TEXT PART', 'text/plain' ); $headers = $this->_createHeaderSet(array(), false); @@ -730,11 +730,11 @@ "\r\n\r\n--xxx\r\n". "Content-Type: text/plain\r\n". "\r\n". - "TEXT PART". + 'TEXT PART'. "\r\n\r\n--xxx\r\n". "Content-Type: text/html\r\n". "\r\n". - "HTML PART". + 'HTML PART'. "\r\n\r\n--xxx--\r\n", $entity->toString() ); @@ -1040,6 +1040,8 @@ return $data; }); + $os->shouldReceive('setReadPointer') + ->zeroOrMoreTimes(); } return $os; diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Mime/AttachmentTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Mime/AttachmentTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Mime/AttachmentTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Mime/AttachmentTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -19,7 +19,7 @@ $disposition = $this->_createHeader('Content-Disposition', 'attachment'); $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition,)), + 'Content-Disposition' => $disposition, )), $this->_createEncoder(), $this->_createCache() ); $this->assertEquals('attachment', $attachment->getDisposition()); @@ -37,7 +37,7 @@ ->zeroOrMoreTimes(); $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition,)), + 'Content-Disposition' => $disposition, )), $this->_createEncoder(), $this->_createCache() ); $attachment->setDisposition('inline'); @@ -84,7 +84,7 @@ ->zeroOrMoreTimes(); $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Type' => $cType,)), + 'Content-Type' => $cType, )), $this->_createEncoder(), $this->_createCache() ); } @@ -98,7 +98,7 @@ array('filename' => 'foo.txt') ); $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition,)), + 'Content-Disposition' => $disposition, )), $this->_createEncoder(), $this->_createCache() ); $this->assertEquals('foo.txt', $attachment->getFilename()); @@ -116,7 +116,7 @@ ->zeroOrMoreTimes(); $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition,)), + 'Content-Disposition' => $disposition, )), $this->_createEncoder(), $this->_createCache() ); $attachment->setFilename('bar.txt'); @@ -138,7 +138,7 @@ ->zeroOrMoreTimes(); $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Type' => $cType,)), + 'Content-Type' => $cType, )), $this->_createEncoder(), $this->_createCache() ); $attachment->setFilename('bar.txt'); @@ -153,7 +153,7 @@ array('size' => 1234) ); $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition,)), + 'Content-Disposition' => $disposition, )), $this->_createEncoder(), $this->_createCache() ); $this->assertEquals(1234, $attachment->getSize()); @@ -171,7 +171,7 @@ ->zeroOrMoreTimes(); $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition,)), + 'Content-Disposition' => $disposition, )), $this->_createEncoder(), $this->_createCache() ); $attachment->setSize(12345); @@ -188,7 +188,7 @@ ->with('filename', 'file.ext'); $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition,)), + 'Content-Disposition' => $disposition, )), $this->_createEncoder(), $this->_createCache() ); $attachment->setFile($file); @@ -312,6 +312,8 @@ return $data; }); + $file->shouldReceive('setReadPointer') + ->zeroOrMoreTimes(); return $file; } diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Mime/ContentEncoder/Base64ContentEncoderTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Mime/ContentEncoder/Base64ContentEncoderTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Mime/ContentEncoder/Base64ContentEncoderTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Mime/ContentEncoder/Base64ContentEncoderTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -179,7 +179,7 @@ $this->_encoder->encodeByteStream($os, $is); $this->assertEquals( "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmMxMjM0NTY3ODkwQUJDREVGR0hJSktMTU5PUFFS\r\n". - "U1RVVldYWVoxMjM0NTY3YWJjZGVmZ2hpamts", + 'U1RVVldYWVoxMjM0NTY3YWJjZGVmZ2hpamts', $collection->content ); } @@ -222,7 +222,7 @@ $this->assertEquals( "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmMxMjM0NTY3OD\r\n". "kwQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVoxMjM0NTY3YWJj\r\n". - "ZGVmZ2hpamts", + 'ZGVmZ2hpamts', $collection->content ); } @@ -264,7 +264,7 @@ $this->_encoder->encodeByteStream($os, $is, 0, 100); $this->assertEquals( "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmMxMjM0NTY3ODkwQUJDREVGR0hJSktMTU5PUFFS\r\n". - "U1RVVldYWVoxMjM0NTY3YWJjZGVmZ2hpamts", + 'U1RVVldYWVoxMjM0NTY3YWJjZGVmZ2hpamts', $collection->content ); } @@ -306,7 +306,7 @@ $this->_encoder->encodeByteStream($os, $is, 19); $this->assertEquals( "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmMxMjM0NTY3ODkwQUJDR\r\n". - "EVGR0hJSktMTU5PUFFSU1RVVldYWVoxMjM0NTY3YWJjZGVmZ2hpamts", + 'EVGR0hJSktMTU5PUFFSU1RVVldYWVoxMjM0NTY3YWJjZGVmZ2hpamts', $collection->content ); } diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Mime/Headers/MailboxHeaderTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Mime/Headers/MailboxHeaderTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Mime/Headers/MailboxHeaderTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Mime/Headers/MailboxHeaderTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -168,7 +168,7 @@ )); $this->assertEquals( array('chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn',), + 'mark@swiftmailer.org' => 'Mark Corbyn', ), $header->getNameAddresses() ); $this->assertEquals( diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Mime/MimePartTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Mime/MimePartTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Mime/MimePartTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Mime/MimePartTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -30,7 +30,7 @@ array('charset' => 'iso-8859-1') ); $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType,)), + 'Content-Type' => $cType, )), $this->_createEncoder(), $this->_createCache() ); $this->assertEquals('iso-8859-1', $part->getCharset()); @@ -44,7 +44,7 @@ $cType->shouldReceive('setParameter')->once()->with('charset', 'utf-8'); $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType,)), + 'Content-Type' => $cType, )), $this->_createEncoder(), $this->_createCache() ); $part->setCharset('utf-8'); @@ -58,7 +58,7 @@ $cType->shouldReceive('setParameter')->once()->with('charset', 'utf-8'); $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType,)), + 'Content-Type' => $cType, )), $this->_createEncoder(), $this->_createCache() ); $part->setBody('', 'text/plian', 'utf-8'); @@ -112,7 +112,7 @@ $cType->shouldReceive('setParameter')->once()->with('charset', 'utf-8'); $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType,)), + 'Content-Type' => $cType, )), $this->_createEncoder(), $this->_createCache() ); $part->charsetChanged('utf-8'); @@ -151,7 +151,7 @@ array('format' => 'flowed') ); $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType,)), + 'Content-Type' => $cType, )), $this->_createEncoder(), $this->_createCache() ); $this->assertEquals('flowed', $part->getFormat()); @@ -163,7 +163,7 @@ $cType->shouldReceive('setParameter')->once()->with('format', 'fixed'); $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType,)), + 'Content-Type' => $cType, )), $this->_createEncoder(), $this->_createCache() ); $part->setFormat('fixed'); @@ -178,7 +178,7 @@ array('delsp' => 'no') ); $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType,)), + 'Content-Type' => $cType, )), $this->_createEncoder(), $this->_createCache() ); $this->assertSame(false, $part->getDelSp()); @@ -190,7 +190,7 @@ $cType->shouldReceive('setParameter')->once()->with('delsp', 'yes'); $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType,)), + 'Content-Type' => $cType, )), $this->_createEncoder(), $this->_createCache() ); $part->setDelSp(true); diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Plugins/BandwidthMonitorPluginTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Plugins/BandwidthMonitorPluginTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Plugins/BandwidthMonitorPluginTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Plugins/BandwidthMonitorPluginTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -9,13 +9,13 @@ public function testBytesOutIncreasesWhenCommandsSent() { - $evt = $this->_createCommandEvent("RCPT TO: \r\n"); + $evt = $this->_createCommandEvent("RCPT TO:\r\n"); $this->assertEquals(0, $this->_monitor->getBytesOut()); $this->_monitor->commandSent($evt); - $this->assertEquals(24, $this->_monitor->getBytesOut()); + $this->assertEquals(23, $this->_monitor->getBytesOut()); $this->_monitor->commandSent($evt); - $this->assertEquals(48, $this->_monitor->getBytesOut()); + $this->assertEquals(46, $this->_monitor->getBytesOut()); } public function testBytesInIncreasesWhenResponsesReceived() @@ -39,13 +39,13 @@ $this->_monitor->responseReceived($evt); $this->assertEquals(16, $this->_monitor->getBytesIn()); - $evt = $this->_createCommandEvent("RCPT TO: \r\n"); + $evt = $this->_createCommandEvent("RCPT TO:\r\n"); $this->assertEquals(0, $this->_monitor->getBytesOut()); $this->_monitor->commandSent($evt); - $this->assertEquals(24, $this->_monitor->getBytesOut()); + $this->assertEquals(23, $this->_monitor->getBytesOut()); $this->_monitor->commandSent($evt); - $this->assertEquals(48, $this->_monitor->getBytesOut()); + $this->assertEquals(46, $this->_monitor->getBytesOut()); $this->_monitor->reset(); diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Plugins/Loggers/EchoLoggerTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Plugins/Loggers/EchoLoggerTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Plugins/Loggers/EchoLoggerTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Plugins/Loggers/EchoLoggerTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -6,19 +6,19 @@ { $logger = new Swift_Plugins_Loggers_EchoLogger(false); ob_start(); - $logger->add(">> Foo"); + $logger->add('>> Foo'); $data = ob_get_clean(); - $this->assertEquals(">> Foo".PHP_EOL, $data); + $this->assertEquals('>> Foo'.PHP_EOL, $data); } public function testAddingEntryDumpsEscapedLineWithHtml() { $logger = new Swift_Plugins_Loggers_EchoLogger(true); ob_start(); - $logger->add(">> Foo"); + $logger->add('>> Foo'); $data = ob_get_clean(); - $this->assertEquals(">> Foo
".PHP_EOL, $data); + $this->assertEquals('>> Foo
'.PHP_EOL, $data); } } diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Signers/DKIMSignerTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Signers/DKIMSignerTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Signers/DKIMSignerTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Signers/DKIMSignerTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -14,7 +14,7 @@ public function testBasicSigningHeaderManipulation() { $headers = $this->_createHeaders(); - $messageContent = "Hello World"; + $messageContent = 'Hello World'; $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))).'/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); /* @var $signer Swift_Signers_HeaderSigner */ $altered = $signer->getAlteredHeaders(); @@ -33,7 +33,7 @@ public function testSigningDefaults() { $headerSet = $this->_createHeaderSet(); - $messageContent = "Hello World"; + $messageContent = 'Hello World'; $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))).'/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); $signer->setSignatureTimestamp('1299879181'); $altered = $signer->getAlteredHeaders(); @@ -55,7 +55,7 @@ public function testSigning256() { $headerSet = $this->_createHeaderSet(); - $messageContent = "Hello World"; + $messageContent = 'Hello World'; $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))).'/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); $signer->setHashAlgorithm('rsa-sha256'); $signer->setSignatureTimestamp('1299879181'); @@ -78,7 +78,7 @@ public function testSigningRelaxedRelaxed256() { $headerSet = $this->_createHeaderSet(); - $messageContent = "Hello World"; + $messageContent = 'Hello World'; $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))).'/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); $signer->setHashAlgorithm('rsa-sha256'); $signer->setSignatureTimestamp('1299879181'); @@ -103,7 +103,7 @@ public function testSigningRelaxedSimple256() { $headerSet = $this->_createHeaderSet(); - $messageContent = "Hello World"; + $messageContent = 'Hello World'; $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))).'/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); $signer->setHashAlgorithm('rsa-sha256'); $signer->setSignatureTimestamp('1299879181'); @@ -127,7 +127,7 @@ public function testSigningSimpleRelaxed256() { $headerSet = $this->_createHeaderSet(); - $messageContent = "Hello World"; + $messageContent = 'Hello World'; $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))).'/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); $signer->setHashAlgorithm('rsa-sha256'); $signer->setSignatureTimestamp('1299879181'); diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Signers/SMimeSignerTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Signers/SMimeSignerTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Signers/SMimeSignerTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Signers/SMimeSignerTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -70,6 +70,49 @@ unset($messageStream); } + public function testSingedMessageExtraCerts() + { + $message = Swift_SignedMessage::newInstance('Wonderful Subject') + ->setFrom(array('john@doe.com' => 'John Doe')) + ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) + ->setBody('Here is the message itself'); + + $signer = new Swift_Signers_SMimeSigner(); + $signer->setSignCertificate($this->samplesDir.'smime/sign2.crt', $this->samplesDir.'smime/sign2.key', PKCS7_DETACHED, $this->samplesDir.'smime/intermediate.crt'); + $message->attachSigner($signer); + + $messageStream = $this->newFilteredStream(); + $message->toByteStream($messageStream); + $messageStream->commit(); + + $entityString = $messageStream->getContent(); + $headers = self::getHeadersOfMessage($entityString); + + if (!($boundary = $this->getBoundary($headers['content-type']))) { + return false; + } + + $expectedBody = <<assertValidVerify($expectedBody, $messageStream); + unset($messageStream); + } + public function testSingedMessageBinary() { $message = Swift_SignedMessage::newInstance('Wonderful Subject') diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/AbstractSmtpEventSupportTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/AbstractSmtpEventSupportTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/AbstractSmtpEventSupportTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/AbstractSmtpEventSupportTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -95,7 +95,7 @@ ->andReturn(array('mark@swiftmailer.org' => 'Mark')); $buf->shouldReceive('write') ->once() - ->with("MAIL FROM: \r\n") + ->with("MAIL FROM:\r\n") ->andReturn(1); $buf->shouldReceive('readLine') ->once() @@ -103,7 +103,7 @@ ->andReturn("250 OK\r\n"); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(2); $buf->shouldReceive('readLine') ->once() @@ -146,7 +146,7 @@ ->andReturn(array('mark@swiftmailer.org' => 'Mark')); $buf->shouldReceive('write') ->once() - ->with("MAIL FROM: \r\n") + ->with("MAIL FROM:\r\n") ->andReturn(1); $buf->shouldReceive('readLine') ->once() @@ -154,7 +154,7 @@ ->andReturn("250 OK\r\n"); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(2); $buf->shouldReceive('readLine') ->once() @@ -200,7 +200,7 @@ )); $buf->shouldReceive('write') ->once() - ->with("MAIL FROM: \r\n") + ->with("MAIL FROM:\r\n") ->andReturn(1); $buf->shouldReceive('readLine') ->once() @@ -208,7 +208,7 @@ ->andReturn("250 OK\r\n"); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(2); $buf->shouldReceive('readLine') ->once() diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/AbstractSmtpTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/AbstractSmtpTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/AbstractSmtpTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/AbstractSmtpTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -235,7 +235,7 @@ ->once(); $buf->shouldReceive('write') ->once() - ->with("MAIL FROM: \r\n") + ->with("MAIL FROM:\r\n") ->andReturn(1); $buf->shouldReceive('readLine') ->once() @@ -265,7 +265,7 @@ ->andReturn(array('foo@bar' => null)); $buf->shouldReceive('write') ->once() - ->with("MAIL FROM: \r\n") + ->with("MAIL FROM:\r\n") ->andReturn(1); $buf->shouldReceive('readLine') ->once() @@ -298,7 +298,7 @@ ->andReturn(array('foo@bar' => null)); $buf->shouldReceive('write') ->once() - ->with("MAIL FROM: \r\n") + ->with("MAIL FROM:\r\n") ->andReturn(1); $buf->shouldReceive('readLine') ->once() @@ -330,7 +330,7 @@ ->andReturn(array('foo@bar' => null)); $buf->shouldReceive('write') ->once() - ->with("MAIL FROM: \r\n") + ->with("MAIL FROM:\r\n") ->andReturn(1); $buf->shouldReceive('readLine') ->once() @@ -404,7 +404,7 @@ ->andReturn(array('foo@bar' => null)); $buf->shouldReceive('write') ->once() - ->with("MAIL FROM: \r\n") + ->with("MAIL FROM:\r\n") ->andReturn(1); $buf->shouldReceive('readLine') ->once() @@ -412,7 +412,7 @@ ->andReturn('250 OK'."\r\n"); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(2); $buf->shouldReceive('readLine') ->once() @@ -442,7 +442,7 @@ ->andReturn(array('foo@bar' => null)); $buf->shouldReceive('write') ->once() - ->with("MAIL FROM: \r\n") + ->with("MAIL FROM:\r\n") ->andReturn(1); $buf->shouldReceive('readLine') ->once() @@ -450,7 +450,7 @@ ->andReturn('250 OK'."\r\n"); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(2); $buf->shouldReceive('readLine') ->once() @@ -458,7 +458,7 @@ ->andReturn('250 OK'."\r\n"); $buf->shouldReceive('write') ->never() - ->with("MAIL FROM: \r\n"); + ->with("MAIL FROM:\r\n"); $this->_finishBuffer($buf); $smtp->start(); @@ -483,7 +483,7 @@ )); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(1); $buf->shouldReceive('readLine') ->once() @@ -491,7 +491,7 @@ ->andReturn('250 OK'."\r\n"); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(2); $buf->shouldReceive('readLine') ->once() @@ -499,7 +499,7 @@ ->andReturn('250 OK'."\r\n"); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(3); $buf->shouldReceive('readLine') ->once() @@ -531,7 +531,7 @@ )); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(1); $buf->shouldReceive('readLine') ->once() @@ -539,7 +539,7 @@ ->andReturn('250 OK'."\r\n"); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(2); $buf->shouldReceive('readLine') ->once() @@ -547,7 +547,7 @@ ->andReturn('250 OK'."\r\n"); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(3); $buf->shouldReceive('readLine') ->once() @@ -579,7 +579,7 @@ )); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(1); $buf->shouldReceive('readLine') ->once() @@ -587,7 +587,7 @@ ->andReturn('250 OK'."\r\n"); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(2); $buf->shouldReceive('readLine') ->once() @@ -595,7 +595,7 @@ ->andReturn('501 Nobody here'."\r\n"); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(3); $buf->shouldReceive('readLine') ->once() @@ -637,7 +637,7 @@ ->andReturn(array('foo@bar' => null)); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(1); $buf->shouldReceive('readLine') ->once() @@ -900,27 +900,27 @@ 'test@domain' => 'Test user', )); - $buf->shouldReceive('write')->once()->with("MAIL FROM: \r\n")->andReturn(1); + $buf->shouldReceive('write')->once()->with("MAIL FROM:\r\n")->andReturn(1); $buf->shouldReceive('readLine')->once()->with(1)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO: \r\n")->andReturn(2); + $buf->shouldReceive('write')->once()->with("RCPT TO:\r\n")->andReturn(2); $buf->shouldReceive('readLine')->once()->with(2)->andReturn("250 OK\r\n"); $buf->shouldReceive('write')->once()->with("DATA\r\n")->andReturn(3); $buf->shouldReceive('readLine')->once()->with(3)->andReturn("354 OK\r\n"); $buf->shouldReceive('write')->once()->with("\r\n.\r\n")->andReturn(4); $buf->shouldReceive('readLine')->once()->with(4)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("MAIL FROM: \r\n")->andReturn(5); + $buf->shouldReceive('write')->once()->with("MAIL FROM:\r\n")->andReturn(5); $buf->shouldReceive('readLine')->once()->with(5)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO: \r\n")->andReturn(6); + $buf->shouldReceive('write')->once()->with("RCPT TO:\r\n")->andReturn(6); $buf->shouldReceive('readLine')->once()->with(6)->andReturn("250 OK\r\n"); $buf->shouldReceive('write')->once()->with("DATA\r\n")->andReturn(7); $buf->shouldReceive('readLine')->once()->with(7)->andReturn("354 OK\r\n"); $buf->shouldReceive('write')->once()->with("\r\n.\r\n")->andReturn(8); $buf->shouldReceive('readLine')->once()->with(8)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("MAIL FROM: \r\n")->andReturn(9); + $buf->shouldReceive('write')->once()->with("MAIL FROM:\r\n")->andReturn(9); $buf->shouldReceive('readLine')->once()->with(9)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO: \r\n")->andReturn(10); + $buf->shouldReceive('write')->once()->with("RCPT TO:\r\n")->andReturn(10); $buf->shouldReceive('readLine')->once()->with(10)->andReturn("250 OK\r\n"); $buf->shouldReceive('write')->once()->with("DATA\r\n")->andReturn(11); $buf->shouldReceive('readLine')->once()->with(11)->andReturn("354 OK\r\n"); @@ -961,7 +961,7 @@ )); $buf->shouldReceive('write') ->once() - ->with("MAIL FROM: \r\n") + ->with("MAIL FROM:\r\n") ->andReturn(1); $buf->shouldReceive('readLine') ->once() @@ -969,7 +969,7 @@ ->andReturn("250 OK\r\n"); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(2); $buf->shouldReceive('readLine') ->once() @@ -1124,25 +1124,25 @@ 'test@domain' => 'Test user', )); - $buf->shouldReceive('write')->once()->with("MAIL FROM: \r\n")->andReturn(1); + $buf->shouldReceive('write')->once()->with("MAIL FROM:\r\n")->andReturn(1); $buf->shouldReceive('readLine')->once()->with(1)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO: \r\n")->andReturn(2); + $buf->shouldReceive('write')->once()->with("RCPT TO:\r\n")->andReturn(2); $buf->shouldReceive('readLine')->once()->with(2)->andReturn("250 OK\r\n"); $buf->shouldReceive('write')->once()->with("DATA\r\n")->andReturn(3); $buf->shouldReceive('readLine')->once()->with(3)->andReturn("354 OK\r\n"); $buf->shouldReceive('write')->once()->with("\r\n.\r\n")->andReturn(4); $buf->shouldReceive('readLine')->once()->with(4)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("MAIL FROM: \r\n")->andReturn(5); + $buf->shouldReceive('write')->once()->with("MAIL FROM:\r\n")->andReturn(5); $buf->shouldReceive('readLine')->once()->with(5)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO: \r\n")->andReturn(6); + $buf->shouldReceive('write')->once()->with("RCPT TO:\r\n")->andReturn(6); $buf->shouldReceive('readLine')->once()->with(6)->andReturn("500 Bad\r\n"); $buf->shouldReceive('write')->once()->with("RSET\r\n")->andReturn(7); $buf->shouldReceive('readLine')->once()->with(7)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("MAIL FROM: \r\n")->andReturn(9); + $buf->shouldReceive('write')->once()->with("MAIL FROM:\r\n")->andReturn(9); $buf->shouldReceive('readLine')->once()->with(9)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO: \r\n")->andReturn(10); + $buf->shouldReceive('write')->once()->with("RCPT TO:\r\n")->andReturn(10); $buf->shouldReceive('readLine')->once()->with(10)->andReturn("500 Bad\r\n"); $buf->shouldReceive('write')->once()->with("RSET\r\n")->andReturn(11); $buf->shouldReceive('readLine')->once()->with(11)->andReturn("250 OK\r\n"); @@ -1200,7 +1200,7 @@ ->andReturn('250 ServerName'."\r\n"); $buf->shouldReceive('write') ->zeroOrMoreTimes() - ->with('~^MAIL FROM: <.*?>\r\n$~D') + ->with('~^MAIL FROM:<.*?>\r\n$~D') ->andReturn($x = uniqid()); $buf->shouldReceive('readLine') ->zeroOrMoreTimes() @@ -1208,7 +1208,7 @@ ->andReturn("250 OK\r\n"); $buf->shouldReceive('write') ->zeroOrMoreTimes() - ->with('~^RCPT TO: <.*?>\r\n$~D') + ->with('~^RCPT TO:<.*?>\r\n$~D') ->andReturn($x = uniqid()); $buf->shouldReceive('readLine') ->zeroOrMoreTimes() diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/Esmtp/Auth/CramMd5AuthenticatorTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/Esmtp/Auth/CramMd5AuthenticatorTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/Esmtp/Auth/CramMd5AuthenticatorTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/Esmtp/Auth/CramMd5AuthenticatorTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -47,7 +47,7 @@ $this->_agent->shouldReceive('executeCommand') ->once() ->with(\Mockery::any(), array(235)) - ->andThrow(new Swift_TransportException("")); + ->andThrow(new Swift_TransportException('')); $this->_agent->shouldReceive('executeCommand') ->once() ->with("RSET\r\n", array(250)); diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/Esmtp/Auth/LoginAuthenticatorTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/Esmtp/Auth/LoginAuthenticatorTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/Esmtp/Auth/LoginAuthenticatorTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/Esmtp/Auth/LoginAuthenticatorTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -47,7 +47,7 @@ $this->_agent->shouldReceive('executeCommand') ->once() ->with(base64_encode('pass')."\r\n", array(235)) - ->andThrow(new Swift_TransportException("")); + ->andThrow(new Swift_TransportException('')); $this->_agent->shouldReceive('executeCommand') ->once() ->with("RSET\r\n", array(250)); diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/Esmtp/Auth/NTLMAuthenticatorTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/Esmtp/Auth/NTLMAuthenticatorTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/Esmtp/Auth/NTLMAuthenticatorTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/Esmtp/Auth/NTLMAuthenticatorTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -2,13 +2,13 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticatorTest extends \SwiftMailerTestCase { - private $_message1 = "4e544c4d535350000100000007020000"; - private $_message2 = "4e544c4d53535000020000000c000c003000000035828980514246973ea892c10000000000000000460046003c00000054004500530054004e00540002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d0000000000"; - private $_message3 = "4e544c4d5353500003000000180018006000000076007600780000000c000c0040000000080008004c0000000c000c0054000000000000009a0000000102000054004500530054004e00540074006500730074004d0045004d00420045005200bf2e015119f6bdb3f6fdb768aa12d478f5ce3d2401c8f6e9caa4da8f25d5e840974ed8976d3ada46010100000000000030fa7e3c677bc301f5ce3d2401c8f6e90000000002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d000000000000000000"; + private $_message1 = '4e544c4d535350000100000007020000'; + private $_message2 = '4e544c4d53535000020000000c000c003000000035828980514246973ea892c10000000000000000460046003c00000054004500530054004e00540002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d0000000000'; + private $_message3 = '4e544c4d5353500003000000180018006000000076007600780000000c000c0040000000080008004c0000000c000c0054000000000000009a0000000102000054004500530054004e00540074006500730074004d0045004d00420045005200bf2e015119f6bdb3f6fdb768aa12d478f5ce3d2401c8f6e9caa4da8f25d5e840974ed8976d3ada46010100000000000030fa7e3c677bc301f5ce3d2401c8f6e90000000002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d000000000000000000'; public function setUp() { - if (!function_exists('mcrypt_module_open') || !function_exists('openssl_random_pseudo_bytes') || !function_exists('bcmul')) { + if (!function_exists('mcrypt_module_open') || !function_exists('openssl_random_pseudo_bytes') || !function_exists('bcmul') || !function_exists('iconv')) { $this->markTestSkipped( 'One of the required functions is not available.' ); @@ -33,9 +33,9 @@ public function testLMv1Generator() { - $password = "test1234"; - $challenge = "b019d38bad875c9d"; - $lmv1 = "1879f60127f8a877022132ec221bcbf3ca016a9f76095606"; + $password = 'test1234'; + $challenge = 'b019d38bad875c9d'; + $lmv1 = '1879f60127f8a877022132ec221bcbf3ca016a9f76095606'; $login = $this->_getAuthenticator(); $lmv1Result = $this->_invokePrivateMethod('createLMPassword', $login, array($password, $this->hex2bin($challenge))); @@ -47,14 +47,14 @@ public function testLMv2Generator() { - $username = "user"; - $password = "SecREt01"; - $domain = "DOMAIN"; - $challenge = "0123456789abcdef"; - $lmv2 = "d6e6152ea25d03b7c6ba6629c2d6aaf0ffffff0011223344"; + $username = 'user'; + $password = 'SecREt01'; + $domain = 'DOMAIN'; + $challenge = '0123456789abcdef'; + $lmv2 = 'd6e6152ea25d03b7c6ba6629c2d6aaf0ffffff0011223344'; $login = $this->_getAuthenticator(); - $lmv2Result = $this->_invokePrivateMethod('createLMv2Password', $login, array($password, $username, $domain, $this->hex2bin($challenge), $this->hex2bin("ffffff0011223344"))); + $lmv2Result = $this->_invokePrivateMethod('createLMv2Password', $login, array($password, $username, $domain, $this->hex2bin($challenge), $this->hex2bin('ffffff0011223344'))); $this->assertEquals($lmv2, bin2hex($lmv2Result), '%s: The keys should be the same cause we use the same values to generate them.' @@ -63,12 +63,12 @@ public function testMessage3v1Generator() { - $username = "test"; - $domain = "TESTNT"; - $workstation = "MEMBER"; - $lmResponse = "1879f60127f8a877022132ec221bcbf3ca016a9f76095606"; - $ntlmResponse = "e6285df3287c5d194f84df1a94817c7282d09754b6f9e02a"; - $message3T = "4e544c4d5353500003000000180018006000000018001800780000000c000c0040000000080008004c0000000c000c0054000000000000009a0000000102000054004500530054004e00540074006500730074004d0045004d004200450052001879f60127f8a877022132ec221bcbf3ca016a9f76095606e6285df3287c5d194f84df1a94817c7282d09754b6f9e02a"; + $username = 'test'; + $domain = 'TESTNT'; + $workstation = 'MEMBER'; + $lmResponse = '1879f60127f8a877022132ec221bcbf3ca016a9f76095606'; + $ntlmResponse = 'e6285df3287c5d194f84df1a94817c7282d09754b6f9e02a'; + $message3T = '4e544c4d5353500003000000180018006000000018001800780000000c000c0040000000080008004c0000000c000c0054000000000000009a0000000102000054004500530054004e00540074006500730074004d0045004d004200450052001879f60127f8a877022132ec221bcbf3ca016a9f76095606e6285df3287c5d194f84df1a94817c7282d09754b6f9e02a'; $login = $this->_getAuthenticator(); $message3 = $this->_invokePrivateMethod('createMessage3', $login, array($domain, $username, $workstation, $this->hex2bin($lmResponse), $this->hex2bin($ntlmResponse))); @@ -80,11 +80,11 @@ public function testMessage3v2Generator() { - $username = "test"; - $domain = "TESTNT"; - $workstation = "MEMBER"; - $lmResponse = "bf2e015119f6bdb3f6fdb768aa12d478f5ce3d2401c8f6e9"; - $ntlmResponse = "caa4da8f25d5e840974ed8976d3ada46010100000000000030fa7e3c677bc301f5ce3d2401c8f6e90000000002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d000000000000000000"; + $username = 'test'; + $domain = 'TESTNT'; + $workstation = 'MEMBER'; + $lmResponse = 'bf2e015119f6bdb3f6fdb768aa12d478f5ce3d2401c8f6e9'; + $ntlmResponse = 'caa4da8f25d5e840974ed8976d3ada46010100000000000030fa7e3c677bc301f5ce3d2401c8f6e90000000002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d000000000000000000'; $login = $this->_getAuthenticator(); $message3 = $this->_invokePrivateMethod('createMessage3', $login, array($domain, $username, $workstation, $this->hex2bin($lmResponse), $this->hex2bin($ntlmResponse))); @@ -126,7 +126,7 @@ public function testGetDomainAndUsernameWithAtSymbol() { - $username = "user@DOMAIN"; + $username = 'user@DOMAIN'; $login = $this->_getAuthenticator(); list($domain, $user) = $this->_invokePrivateMethod('getDomainAndUsername', $login, array($username)); @@ -141,7 +141,7 @@ public function testGetDomainAndUsernameWithAtSymbolAndExtension() { - $username = "user@domain.com"; + $username = 'user@domain.com'; $login = $this->_getAuthenticator(); list($domain, $user) = $this->_invokePrivateMethod('getDomainAndUsername', $login, array($username)); @@ -156,9 +156,9 @@ public function testSuccessfulAuthentication() { - $domain = "TESTNT"; - $username = "test"; - $secret = "test1234"; + $domain = 'TESTNT'; + $username = 'test'; + $secret = 'test1234'; $ntlm = $this->_getAuthenticator(); $agent = $this->_getAgent(); @@ -167,23 +167,23 @@ ->with('AUTH NTLM '.base64_encode( $this->_invokePrivateMethod('createMessage1', $ntlm) )."\r\n", array(334)) - ->andReturn("334 ".base64_encode($this->hex2bin("4e544c4d53535000020000000c000c003000000035828980514246973ea892c10000000000000000460046003c00000054004500530054004e00540002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d0000000000"))); + ->andReturn('334 '.base64_encode($this->hex2bin('4e544c4d53535000020000000c000c003000000035828980514246973ea892c10000000000000000460046003c00000054004500530054004e00540002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d0000000000'))); $agent->shouldReceive('executeCommand') ->once() ->with(base64_encode( - $this->_invokePrivateMethod('createMessage3', $ntlm, array($domain, $username, $this->hex2bin("4d0045004d00420045005200"), $this->hex2bin("bf2e015119f6bdb3f6fdb768aa12d478f5ce3d2401c8f6e9"), $this->hex2bin("caa4da8f25d5e840974ed8976d3ada46010100000000000030fa7e3c677bc301f5ce3d2401c8f6e90000000002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d000000000000000000")) + $this->_invokePrivateMethod('createMessage3', $ntlm, array($domain, $username, $this->hex2bin('4d0045004d00420045005200'), $this->hex2bin('bf2e015119f6bdb3f6fdb768aa12d478f5ce3d2401c8f6e9'), $this->hex2bin('caa4da8f25d5e840974ed8976d3ada46010100000000000030fa7e3c677bc301f5ce3d2401c8f6e90000000002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d000000000000000000')) ))."\r\n", array(235)); - $this->assertTrue($ntlm->authenticate($agent, $username.'@'.$domain, $secret, $this->hex2bin("30fa7e3c677bc301"), $this->hex2bin("f5ce3d2401c8f6e9")), + $this->assertTrue($ntlm->authenticate($agent, $username.'@'.$domain, $secret, $this->hex2bin('30fa7e3c677bc301'), $this->hex2bin('f5ce3d2401c8f6e9')), '%s: The buffer accepted all commands authentication should succeed' ); } public function testAuthenticationFailureSendRsetAndReturnFalse() { - $domain = "TESTNT"; - $username = "test"; - $secret = "test1234"; + $domain = 'TESTNT'; + $username = 'test'; + $secret = 'test1234'; $ntlm = $this->_getAuthenticator(); $agent = $this->_getAgent(); @@ -192,12 +192,12 @@ ->with('AUTH NTLM '.base64_encode( $this->_invokePrivateMethod('createMessage1', $ntlm) )."\r\n", array(334)) - ->andThrow(new Swift_TransportException("")); + ->andThrow(new Swift_TransportException('')); $agent->shouldReceive('executeCommand') ->once() ->with("RSET\r\n", array(250)); - $this->assertFalse($ntlm->authenticate($agent, $username.'@'.$domain, $secret, $this->hex2bin("30fa7e3c677bc301"), $this->hex2bin("f5ce3d2401c8f6e9")), + $this->assertFalse($ntlm->authenticate($agent, $username.'@'.$domain, $secret, $this->hex2bin('30fa7e3c677bc301'), $this->hex2bin('f5ce3d2401c8f6e9')), '%s: Authentication fails, so RSET should be sent' ); } @@ -222,8 +222,10 @@ } /** - * Hex2bin replacement for < PHP 5.4 + * Hex2bin replacement for < PHP 5.4. + * * @param string $hex + * * @return string Binary */ protected function hex2bin($hex) diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/Esmtp/Auth/PlainAuthenticatorTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/Esmtp/Auth/PlainAuthenticatorTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/Esmtp/Auth/PlainAuthenticatorTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/Esmtp/Auth/PlainAuthenticatorTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -50,7 +50,7 @@ ->with('AUTH PLAIN '.base64_encode( 'jack'.chr(0).'jack'.chr(0).'pass' )."\r\n", array(235)) - ->andThrow(new Swift_TransportException("")); + ->andThrow(new Swift_TransportException('')); $this->_agent->shouldReceive('executeCommand') ->once() ->with("RSET\r\n", array(250)); diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/EsmtpTransport/ExtensionSupportTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/EsmtpTransport/ExtensionSupportTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/EsmtpTransport/ExtensionSupportTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/EsmtpTransport/ExtensionSupportTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -177,7 +177,7 @@ ->andReturn("250 SIZE=123456\r\n"); $buf->shouldReceive('write') ->once() - ->with("MAIL FROM: FOO ZIP\r\n") + ->with("MAIL FROM: FOO ZIP\r\n") ->andReturn(2); $buf->shouldReceive('readLine') ->once() @@ -185,7 +185,7 @@ ->andReturn("250 OK\r\n"); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: \r\n") + ->with("RCPT TO:\r\n") ->andReturn(3); $buf->shouldReceive('readLine') ->once() @@ -263,7 +263,7 @@ ->andReturn("250 SIZE=123456\r\n"); $buf->shouldReceive('write') ->once() - ->with("MAIL FROM: \r\n") + ->with("MAIL FROM:\r\n") ->andReturn(2); $buf->shouldReceive('readLine') ->once() @@ -271,7 +271,7 @@ ->andReturn("250 OK\r\n"); $buf->shouldReceive('write') ->once() - ->with("RCPT TO: FOO ZIP\r\n") + ->with("RCPT TO: FOO ZIP\r\n") ->andReturn(3); $buf->shouldReceive('readLine') ->once() @@ -414,7 +414,7 @@ ->andReturnUsing(function ($a, $b, $c, $d, &$e) { $e = true; - return "250 ok"; + return '250 ok'; }); $ext2->shouldReceive('getHandledKeyword') ->zeroOrMoreTimes() diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/FailoverTransportTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/FailoverTransportTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/FailoverTransportTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/FailoverTransportTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -517,9 +517,4 @@ { return $this->getMockery('Swift_Events_EventListener'); } - - private function _createInnerTransport() - { - return $this->getMockery('Swift_Transport'); - } } diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/LoadBalancedTransportTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/LoadBalancedTransportTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/LoadBalancedTransportTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/LoadBalancedTransportTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -714,7 +714,7 @@ } /** - * Adapted from Yay_Matchers_ReferenceMatcher + * Adapted from Yay_Matchers_ReferenceMatcher. */ public function varsAreReferences(&$ref1, &$ref2) { @@ -748,9 +748,4 @@ { return $this->getMockery('Swift_Events_EventListener'); } - - private function _createInnerTransport() - { - return $this->getMockery('Swift_Transport'); - } } diff -Nru libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/MailTransportTest.php libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/MailTransportTest.php --- libphp-swiftmailer-5.2.2/tests/unit/Swift/Transport/MailTransportTest.php 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/tests/unit/Swift/Transport/MailTransportTest.php 2015-06-06 14:19:39.000000000 +0000 @@ -31,10 +31,10 @@ $to->shouldReceive('getFieldBody') ->zeroOrMoreTimes() - ->andReturn("Foo "); + ->andReturn('Foo '); $invoker->shouldReceive('mail') ->once() - ->with("Foo ", \Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); + ->with('Foo ', \Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); $transport->send($message); } @@ -53,10 +53,10 @@ $subj->shouldReceive('getFieldBody') ->zeroOrMoreTimes() - ->andReturn("Thing"); + ->andReturn('Thing'); $invoker->shouldReceive('mail') ->once() - ->with(\Mockery::any(), "Thing", \Mockery::any(), \Mockery::any(), \Mockery::any()); + ->with(\Mockery::any(), 'Thing', \Mockery::any(), \Mockery::any(), \Mockery::any()); $transport->send($message); } @@ -75,11 +75,11 @@ ->andReturn( "To: Foo \r\n". "\r\n". - "This body" + 'This body' ); $invoker->shouldReceive('mail') ->once() - ->with(\Mockery::any(), \Mockery::any(), "This body", \Mockery::any(), \Mockery::any()); + ->with(\Mockery::any(), \Mockery::any(), 'This body', \Mockery::any(), \Mockery::any()); $transport->send($message); } @@ -98,11 +98,11 @@ ->andReturn( "Subject: Stuff\r\n". "\r\n". - "This body" + 'This body' ); $invoker->shouldReceive('mail') ->once() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), "Subject: Stuff".PHP_EOL, \Mockery::any()); + ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), 'Subject: Stuff'.PHP_EOL, \Mockery::any()); $transport->send($message); } diff -Nru libphp-swiftmailer-5.2.2/VERSION libphp-swiftmailer-5.4.1/VERSION --- libphp-swiftmailer-5.2.2/VERSION 2014-09-20 07:17:36.000000000 +0000 +++ libphp-swiftmailer-5.4.1/VERSION 2015-06-06 14:19:39.000000000 +0000 @@ -1 +1 @@ -Swift-5.2.2 +Swift-5.4.1