Commit 9c9c4f3b authored by Georg Ringer's avatar Georg Ringer Committed by Andreas Fernandez
Browse files

[TASK] Add early check for validating email address

GeneralUtility::validEmail is called for all legacy link formats like
page ids. To avoid triggering Egulias\EmailValidator an early check for
the `@` sign has been added.

Resolves: #95042
Releases: master, 10.4
Change-Id: I7720a7e771d0f31f53a72e7a1a9377a9256f6014
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70855

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Stephan Großberndt's avatarStephan Großberndt <stephan.grossberndt@typo3.org>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Stephan Großberndt's avatarStephan Großberndt <stephan.grossberndt@typo3.org>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent d3f6c5f0
......@@ -814,6 +814,9 @@ class GeneralUtility
if (trim($email) !== $email) {
return false;
}
if (strpos($email, '@') === false) {
return false;
}
$validators = [];
foreach ($GLOBALS['TYPO3_CONF_VARS']['MAIL']['validators'] ?? [RFCValidation::class] as $className) {
$validator = new $className();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment