Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Mime: base64 encoded string must be multiple of 4 chars #2

Merged
merged 2 commits into from Apr 20, 2016

Conversation

echampet
Copy link
Contributor

this fixes encodeBase64Header()

Etienne CHAMPETIER added 2 commits May 29, 2015 17:05
Signed-off-by: Etienne CHAMPETIER <etienne.champetier@fiducial.net>
Signed-off-by: Etienne CHAMPETIER <etienne.champetier@fiducial.net>
*/
public function testEncodeMailHeaderBase64wrap($str)
{
$this->assertEquals($str, Mime\Decode::decodeQuotedPrintable(Mime\Mime::encodeBase64Header($str, "UTF-8", 20)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you try to execute this test without "the fix"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were 2 failures:

1) ZendTest\Mime\MimeTest::testEncodeMailHeaderBase64wrap with data set #0 ('äöüäöüäöüäöüäö�...äöü')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'äöüäöüäöüäöüäöüäöüäöü'
+'äöü=?UTF-8?B?6TDtsO8w6?= =?UTF-8?B?TDtsO8w6T?= =?UTF-8?B?DtsO8w6TD?= =?UTF-8?B?tsO8w6TDt?= =?UTF-8?B?sO8w6TDts?= ;'

.../zend-mime/test/MimeTest.php:142

2) ZendTest\Mime\MimeTest::testEncodeMailHeaderBase64wrap with data set #1 ('Alle meine Entchen schwimmen ... Höh!')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Alle meine Entchen schwimmen in dem See, schwimmen in dem See, Köpfchen in das Wasser, Schwänzchen in die Höh!'
+'Alle m=?UTF-8?B?WluZSBFbn?= =?UTF-8?B?RjaGVuIHN?= =?UTF-8?B?jaHdpbW1l?= n in d=?UTF-8?B?W0gU2VlLC?= =?UTF-8?B?BzY2h3aW1?= =?UTF-8?B?tZW4gaW4g?= dem Se=?UTF-8?B?SwgS8O2cG?= =?UTF-8?B?ZjaGVuIGl?= =?UTF-8?B?uIGRhcyBX?= asser,=?UTF-8?B?FNjaHfDpG?= =?UTF-8?B?56Y2hlbiB?= =?UTF-8?B?pbiBkaWUg?= Höh!'

.../zend-mime/test/MimeTest.php:142

@champtar
Copy link

ping

@weierophinney weierophinney merged commit b2a21b1 into zendframework:master Apr 20, 2016
weierophinney added a commit that referenced this pull request Apr 20, 2016
 Mime: base64 encoded string must be multiple of 4 chars
weierophinney added a commit that referenced this pull request Apr 20, 2016
weierophinney added a commit that referenced this pull request Apr 20, 2016
weierophinney added a commit that referenced this pull request Apr 20, 2016
@weierophinney weierophinney added this to the 2.5.2 milestone Apr 20, 2016
@weierophinney weierophinney self-assigned this Apr 20, 2016
weierophinney pushed a commit that referenced this pull request May 14, 2018
added another comment for better understanding
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants