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

Fix #92 : Allow whitespace empty in empty single line header#196

Merged
weierophinney merged 7 commits intozendframework:masterfrom
samsonasik:fix-92
Jun 6, 2018
Merged

Fix #92 : Allow whitespace empty in empty single line header#196
weierophinney merged 7 commits intozendframework:masterfrom
samsonasik:fix-92

Conversation

@samsonasik
Copy link
Contributor

Fix #92

@samsonasik samsonasik changed the title Fix #92 : Allow whitespace empty line Fix #92 : Allow whitespace empty in empty single line header Mar 1, 2018
@chrisdeeming
Copy link

Unfortunately this isn't the totally correct fix as far as I can tell. It will work in some cases, but only if there are no more than 1 empty lines. We're seeing examples of headers that contain upwards of 5-10 empty lines.

Admittedly, that kind of email is clearly in the wrong in terms of the spec (though it seems a bit of a grey area in places) but there are libraries out there which seem to be able to parse such emails correctly without falling over on an arbitrary limit of empty lines.

public function testAllowWhitespaceInEmptySingleLineHeader()
{
$src = "From: user@example.com\nTo: userpal@example.net\nSubject: This is your reminder\n \n about the football game tonight\nDate: Wed, 20 Oct 2010 20:53:35 -0400\n\nDon't forget to meet us for the tailgate party!\n";
$message = new Message(array('raw' => $src));
Copy link
Contributor

Choose a reason for hiding this comment

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

consistency: short array syntax

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done ;)

@samsonasik
Copy link
Contributor Author

@chrisdeeming that probably an edge case that should not be handled ^^

@weierophinney weierophinney merged commit 6762645 into zendframework:master Jun 6, 2018
weierophinney added a commit that referenced this pull request Jun 6, 2018
Fix #92 : Allow whitespace empty in empty single line header
weierophinney added a commit that referenced this pull request Jun 6, 2018
weierophinney added a commit that referenced this pull request Jun 6, 2018
weierophinney added a commit that referenced this pull request Jun 6, 2018
@weierophinney
Copy link
Member

Thanks, @samsonasik.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants