Bug #95042
closedemail validation makes link generation unnecessary costly
100%
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.
Updated by Gerrit Code Review about 3 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70855
Updated by Christian Kuhn about 3 years ago
- Related to Bug #93890: Move email check in LegacyLinkNotationConverter to the end added
Updated by Gerrit Code Review about 3 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71195
Updated by Gerrit Code Review about 3 years ago
Patch set 2 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71195
Updated by Gerrit Code Review about 3 years ago
Patch set 3 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71195
Updated by Georg Ringer about 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 9c9c4f3b4724e4709a575d708829e443f573eb81.