From 032a6fa60800e7daa460ebb854503879af69d265 Mon Sep 17 00:00:00 2001 From: Philip Schmidt Date: Tue, 16 Mar 2021 15:39:03 +0100 Subject: [PATCH] fix regex for links with attributes after href --- Resources/Private/Fusion/Prototype/MailObfuscator.fusion | 2 +- Tests/Unit/Fusion/ConvertEmailLinksImplementationTest.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Resources/Private/Fusion/Prototype/MailObfuscator.fusion b/Resources/Private/Fusion/Prototype/MailObfuscator.fusion index 8c48f3a..2cfc56d 100644 --- a/Resources/Private/Fusion/Prototype/MailObfuscator.fusion +++ b/Resources/Private/Fusion/Prototype/MailObfuscator.fusion @@ -18,7 +18,7 @@ prototype(Networkteam.Neos:MailObfuscator) { @class = 'Networkteam\\Neos\\MailObfuscator\\Fusion\\ConvertEmailLinksImplementation' patternMailTo = '/(href=")mailto:([^"]*)/' - patternMailDisplay = '/(href="mailto:[^"]*">)([^<]*)/' + patternMailDisplay = '/(href="mailto:[^>]*>)([^<]*)/' value = ${value} node = ${node} diff --git a/Tests/Unit/Fusion/ConvertEmailLinksImplementationTest.php b/Tests/Unit/Fusion/ConvertEmailLinksImplementationTest.php index 9395ce8..b8f445e 100644 --- a/Tests/Unit/Fusion/ConvertEmailLinksImplementationTest.php +++ b/Tests/Unit/Fusion/ConvertEmailLinksImplementationTest.php @@ -100,6 +100,10 @@ public function emailTexts() 'email address with space at the beginning' => [ 'Email test@example.com', 'Email test (at) example.com' + ], + 'email address with attributes after href' => [ + 'Email test@example.com', + 'Email test (at) example.com' ] ]; }