Issue Bug Closed

#81471Catch InvalidArgumentException thrown in \TYPO3\CMS\Core\Utility\GeneralUtility::idnaEncode

Nicole Hummel 06/05/17, 14:29 updated 10/02/18, 11:00

Description

Given:

A string with an invalid email address `“mailto:2388511372@qq.com”`.

Expected:

TYPO3\CMS\Core\Utility\GeneralUtility::validEmail should return false.

Actual:

An exception `Conversion from UTF-8 to UCS-4 failed: malformed input at byte 8` is thrown.

The whole problem occurred in \TYPO3\CMS\Core\LinkHandling\LegacyLinkNotationConverter::resolve() during an upgrade from TYPO3 7 LTS to TYPO3 8 LTS. The link which is parsed is `<link>2388511372@qq.com`. Please don’t ask how this happens, I don’t know. But I wouldn’t expect the validEmail() function to throw an error.

Reviews 3