Skip to content

[Mime] Throw exception when body in Email attach method is not ok #46367

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

Merged

Conversation

alamirault
Copy link
Contributor

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #45350
License MIT
Doc PR symfony/symfony-docs#...

As proposed in #45350, throw exception when calling (new Email())->attach($badBodyType); when type is not supported

@carsonbot carsonbot added this to the 4.4 milestone May 16, 2022
@alamirault alamirault force-pushed the fix-45350-exception-when-invalid-attach branch from 402997f to 30f7dc8 Compare May 16, 2022 20:04
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

A few more methods would need the check, eg embed()

@@ -272,12 +272,16 @@ public function getPriority(): int
}

/**
* @param resource|string $body
* @param resource|string|null $body
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was not documented before but null car be pass

@alamirault alamirault requested a review from nicolas-grekas May 17, 2022 17:47
@alamirault alamirault requested a review from nicolas-grekas May 17, 2022 17:59
@nicolas-grekas nicolas-grekas force-pushed the fix-45350-exception-when-invalid-attach branch from d8a0ee1 to 8561c4e Compare May 21, 2022 10:11
@nicolas-grekas
Copy link
Member

Thank you @alamirault.

@nicolas-grekas nicolas-grekas merged commit f3df3d0 into symfony:4.4 May 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants