Skip to content

Commit

Permalink
fix regex for links with attributes after href
Browse files Browse the repository at this point in the history
  • Loading branch information
esdete2 committed Mar 16, 2021
1 parent e2a2bbd commit 032a6fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Resources/Private/Fusion/Prototype/MailObfuscator.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 4 additions & 0 deletions Tests/Unit/Fusion/ConvertEmailLinksImplementationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ public function emailTexts()
'email address with space at the beginning' => [
'Email <a href="mailto: [email protected]">[email protected]</a>',
'Email <a href="javascript:linkTo_UnCryptMailto(\'ithiOtmpbeat-rdb\', -15)">test (at) example.com</a>'
],
'email address with attributes after href' => [
'Email <a href="mailto: [email protected]" itemprop="email">[email protected]</a>',
'Email <a href="javascript:linkTo_UnCryptMailto(\'ithiOtmpbeat-rdb\', -15)" itemprop="email">test (at) example.com</a>'
]
];
}
Expand Down

0 comments on commit 032a6fa

Please sign in to comment.