[stable5.7] chore(deps): Update horde-mime to 2.14.1#12766
[stable5.7] chore(deps): Update horde-mime to 2.14.1#12766
Conversation
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $converted = @mb_convert_encoding($data, 'UTF-8', $charset); | ||
| if ($converted === false) { | ||
| if ($converted === false && $charset !== null) { | ||
| // Might be a charset that PHP mb doesn't know how to handle, fall back to iconv | ||
| $converted = iconv($charset, 'UTF-8', $data); | ||
| } |
There was a problem hiding this comment.
The new guard avoids calling iconv() with a null $charset, but we don't currently have a unit test that exercises the “no charset specified + conversion fails” path (which previously could raise a TypeError). Consider adding a test case that sets no charset and uses non‑UTF8/invalid bytes such that mb_convert_encoding() returns false, asserting we get the expected ServiceException (and no TypeError).
To unblock #12765
Psalm is flagging, that getRaw might return
string|resource.This is resolved by updating horde-mim (https://github.com/bytestream/Mime/releases/tag/v2.14.0 and https://github.com/bytestream/Mime/releases/tag/v2.14.1).
If you prfer to not update, then we can add a safe-guard as I had in an older iteration of it: 6a2e51c#diff-36c8130b1bc43570dee0d419c85f7000c236fb81c05782f8c9251600128a98e0R451.