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

Incorrect parsing of Boundary #39

Closed
AntonioDiPassio-AppSys opened this issue Oct 29, 2020 · 4 comments
Closed

Incorrect parsing of Boundary #39

AntonioDiPassio-AppSys opened this issue Oct 29, 2020 · 4 comments
Labels
bug Something isn't working validated

Comments

@AntonioDiPassio-AppSys
Copy link

Structure::getBoundary uses incorrect regex.
$boundary = $this->header->find("/boundary\=\"?(.*)\"?/");

I have a header which contains:

Content-Type: multipart/related;
	boundary="_004_DBAPR05MB6871D506604AD447C496F0EBE4140DBAPR05MB6871eurp_";
	type="multipart/alternative"

And the boundary gets parsed as: 004_DBAPR05MB6871D506604AD447C496F0EBE4140DBAPR05MB6871eurp";

If you change the regex to: /boundary=\"?(.*)\"/" , it is parsed correctly, and you don't need the str_replace afterwards.

This will fix a problem where there is an inline image, and it doesn't get parsed as an attachment. (And maybe some other problems too)

@AntonioDiPassio-AppSys
Copy link
Author

After some thought, I feel the regex should be: /boundary="?([^"]*)"?/
So in PHP this would be: $boundary = $this->header->find("/boundary=\"?([^\"]*)\"?/");

@Webklex
Copy link
Owner

Webklex commented Nov 6, 2020

Hi @AntonioDiPassio-AppSys ,
thanks for your report. I looks like this might also solve #36 ? :)

Best regards,

@Webklex Webklex added bug Something isn't working validating labels Nov 6, 2020
@AntonioDiPassio-AppSys
Copy link
Author

@Webklex , yes looks like it would.

Webklex added a commit that referenced this issue Dec 11, 2020
@Webklex
Copy link
Owner

Webklex commented Dec 11, 2020

Hi @AntonioDiPassio-AppSys ,
thanks again for your report 👍

Please update your php-imap dependency to v2.2.5.

Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validated
Projects
None yet
Development

No branches or pull requests

2 participants