Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiny fix for the boundary parsing #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sergeypayu
Copy link

A better boundary detection that won't fail on such example:
Content-Type: multipart/report;
boundary="----=_Part_2509169_1730566862.1445846478023";
report-type=delivery-status

A better boundary detection that won't fail on such example:
Content-Type: multipart/report; 
	boundary="----=_Part_2509169_1730566862.1445846478023"; 
	report-type=delivery-status
@djmattyg007
Copy link

Hi there. I'm interested in including this change in my fork of this library: https://github.com/djmattyg007/official-library-php-email-parser

Would you be able to explain in a bit more detail what the change is and why it wouldn't work properly in the past? Also, would you be able to add a test email in the tests directory that will only pass with this change?

@sergeypayu
Copy link
Author

The change I made addresses the issue with parsing boundary string if there is more data on the line. Like in provided example boundary="----=_Part_2509169_1730566862.1445846478023"; report-type=delivery-status
Before my fix it would have taken the whole string till the end as boundary, while we need only the part between "=" and ";".

@djmattyg007
Copy link

I've just pushed a new version of my library that includes this fix. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants