User tests: Successful: Unsuccessful:
Fixes #46842.
EmailRule::test() leaks Algo26\IdnaConvert\Exception\InvalidCharacterException instead of the documented \UnexpectedValueException when an email contains prohibited characters in the domain (e.g. ! or _).
6.0 uses algo26-matthias/idna-convert ^4.2.1 which throws InvalidCharacterException for prohibited domain characters. This was not caught, bypassing the expected UnexpectedValueException.
Wraps both PunycodeHelper::emailToPunycode() calls in EmailRule::test() to catch InvalidCharacterException and throw the expected UnexpectedValueException.
Test plan
Unit tests from PR #46723 (EmailRuleTest.php) should now pass on 6.0-dev
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
I would rather change the unit tests and expect there a different exception. This here can be counted as BC break as on J6 we have now a different exception thrown.
@Bodge-IT I agree with Allon, change the expected result in the unit test. And please do it in your upmerge PR so we can see if it works.
| Status | Pending | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-02-06 14:51:38 |
| Closed_By | ⇒ | Bodge-IT | |
| Labels |
Added:
bug
PR-6.0-dev
Code Review
|
||
I would rather change the unit tests and expect there a different exception. This here can be counted as BC break as on J6 we have now a different exception thrown.