Skip to content

Commit

Permalink
Merge pull request #33 from networkteam/fix-mailto-anchor-parameters
Browse files Browse the repository at this point in the history
Fix: Apply mailto anchor link parameters
  • Loading branch information
ger4003 authored Aug 13, 2024
2 parents 111d2e3 + 2c939aa commit 1db9b90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Classes/Fusion/ConvertEmailLinksImplementation.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ public function convertLinkName(array $matches)
*/
public function convertMailLink($matches)
{
$email = trim($matches[2]);
// make sure that URL parameter dividers (`&`) are not encoded
$email = html_entity_decode(trim($matches[2]), ENT_QUOTES | ENT_HTML5);
$replacedHrefContent = $this->mailToHrefConverter->convert($email);

return $matches[1] . htmlspecialchars($replacedHrefContent);
$uri = new \GuzzleHttp\Psr7\Uri($replacedHrefContent);
return $matches[1] . (string)$uri;
}
}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "A email address and link obfuscation plugin for Neos CMS",
"require": {
"php": ">=7.1",
"neos/neos": "^3.0 || ^4.0 || ^5.0 || ^7.0 || ^8.0"
"neos/neos": "^3.0 || ^4.0 || ^5.0 || ^7.0 || ^8.0",
"guzzlehttp/guzzle": "*"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 1db9b90

Please sign in to comment.