bug PR-6.0-dev Code Review Pending

User tests: Successful: Unsuccessful:

avatar Bodge-IT
Bodge-IT
6 Feb 2026

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

Link to documentations

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

avatar Bodge-IT Bodge-IT - open - 6 Feb 2026
avatar Bodge-IT Bodge-IT - change - 6 Feb 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Feb 2026
Category Libraries
avatar laoneo
laoneo - comment - 6 Feb 2026

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.

avatar richard67
richard67 - comment - 6 Feb 2026

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.

avatar Bodge-IT Bodge-IT - change - 6 Feb 2026
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
avatar Bodge-IT Bodge-IT - close - 6 Feb 2026
avatar Bodge-IT
Bodge-IT - comment - 6 Feb 2026

OK, I'll close this and push through the #46840 and test results there.

Add a Comment

Login with GitHub to post a comment