Actions
Bug #95042
closedemail validation makes link generation unnecessary costly
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Performance
Target version:
-
Start date:
2021-08-31
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
Whenever links are generated with "legacy" parameter, the \TYPO3\CMS\Core\LinkHandling\LegacyLinkNotationConverter
checks if the provided parameter is a valid email address. For validation we use the 3rd party library egulias/email-validator
. With blackfire I determined that this library is quite costly in terms of memory and wall time.
I added this simple early return to GeneralUtility::validEmail()
:
if (strpos($email, '@') === false) {
return false;
}
And it significantly improved the speed of links generation. I don't know if that is a suitable solution for the core, or if such a fix should get into the library itself.
Actions