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

Inverse decode-split order, allow special char containing labels #44

Merged
merged 1 commit into from
Apr 11, 2016

Conversation

mleko
Copy link
Contributor

@mleko mleko commented Dec 2, 2015

No description provided.

@mleko mleko mentioned this pull request Dec 7, 2015
@weierophinney weierophinney added this to the 2.6.2 milestone Apr 11, 2016
@weierophinney weierophinney self-assigned this Apr 11, 2016
@weierophinney weierophinney merged commit 91d0098 into zendframework:master Apr 11, 2016
weierophinney added a commit that referenced this pull request Apr 11, 2016
Inverse decode-split order, allow special char containing labels
weierophinney added a commit that referenced this pull request Apr 11, 2016
weierophinney added a commit that referenced this pull request Apr 11, 2016
weierophinney added a commit that referenced this pull request Apr 11, 2016
@mleko mleko deleted the fix/special-chars branch April 19, 2016 08:11
glensc added a commit to eventum/zend-mail that referenced this pull request Jan 18, 2017
@glensc
Copy link
Contributor

glensc commented Jan 18, 2017

this changeset broke:

                '"Erika Mkaitė" <erika@example.net>, Rööt (Šuperuser) <root@example.org>',

was supposed to parse out two addresses, but parses only one.

i think problem is with use of str_getcsv($fieldValue, ','); it should split this on comma, but does not.

EDIT: seems my input is qp encoded as this:

"Erika =?utf-8?b?TWthaXTElyI=?= <erika@example.net>, =?utf-8?b?UsO2w7Z0IA==?= =?utf-8?b?KMWgdXBlcnVzZXIp?= <root@example.org>

which results:

➔ php53 -r 'var_export(str_getcsv("\"Erika =?utf-8?b?TWthaXTElyI=?= <erika@example.net>, =?utf-8?b?UsO2w7Z0IA==?= =?utf-8?b?KMWgdXBlcnVzZXIp?= <root@example.org>", ","));'
array (
  0 => 'Erika =?utf-8?b?TWthaXTElyI=?= <erika@example.net>, =?utf-8?b?UsO2w7Z0IA==?= =?utf-8?b?KMWgdXBlcnVzZXIp?= <root@example.org>',

is my input incorrect? i don't think the " are supposed to be in "pairs" when QP encoded. they should be balanced after QP decode.

@glensc
Copy link
Contributor

glensc commented Jan 18, 2017

oddly, if i encode the raw input using HeaderWrap::mimeEncodeValue result gets split properly altho i see unbalanced " there:

        $decodedValue = HeaderWrap::mimeEncodeValue($addresses, 'UTF-8');

➔ php53 -r 'var_export(str_getcsv("=?UTF-8?Q?\"Erika=20=3D=3Futf-8=3Fb=3FTWthaXTElyI=3D=3F=3D=20<erika@example.net>,=20=3D=3Futf-8=3Fb=3FUsO2w7Z0IA=3D=3D=3F=3D=20=3D=3Futf-8=3Fb=3FKMWgdXBlcnVzZXIp=3F=3D=20<root@example.org>?=", ","));'
array (
  0 => '=?UTF-8?Q?"Erika=20=3D=3Futf-8=3Fb=3FTWthaXTElyI=3D=3F=3D=20<erika@example.net>',
  1 => '=20=3D=3Futf-8=3Fb=3FUsO2w7Z0IA=3D=3D=3F=3D=20=3D=3Futf-8=3Fb=3FKMWgdXBlcnVzZXIp=3F=3D=20<root@example.org>?=',
)

glensc added a commit to eventum/eventum that referenced this pull request Jan 18, 2017
this method of encoding does not leave quotes unpaired
and doesn't trigger error after this PR was merged:
zendframework/zend-mail#44
glensc added a commit to eventum/eventum that referenced this pull request Apr 26, 2017
this method of encoding does not leave quotes unpaired
and doesn't trigger error after this PR was merged:
zendframework/zend-mail#44
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.

3 participants