URL-encode the email address used within the `href`
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 18 May 2020 15:18:02 +0000 (17:18 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 18 May 2020 15:21:43 +0000 (17:21 +0200)
This fixes issues with broken links if the email address contains
special characters.

files/lib/page/LegalNoticePage.class.php
templates/legalNotice.tpl

index cb8261f104193ea249dfdb3182832fc16b12794f..e872eb2c1fc770426cc9b3aee2c59b41f2f0c620 100644 (file)
@@ -31,7 +31,8 @@ class LegalNoticePage extends AbstractPage {
                parent::assignVariables();
                
                WCF::getTPL()->assign([
-                       'encodedEmailAddress' => StringUtil::encodeAllChars(LEGAL_NOTICE_EMAIL_ADDRESS)
+                       'encodedEmailAddress' => StringUtil::encodeAllChars(LEGAL_NOTICE_EMAIL_ADDRESS),
+                       'encodedUriEmailAddress' => StringUtil::encodeAllChars(rawurlencode(LEGAL_NOTICE_EMAIL_ADDRESS)),
                ]);
        }
 }
index 492042489f7342bb1be6b5a2fea85dc2488a94ba..f9a688b467065da689ee5eea2a76c8448828c208 100644 (file)
@@ -13,7 +13,7 @@
                
                {if $encodedEmailAddress}
                        <dt>{lang}wcf.legalNotice.emailAddress{/lang}</dt>
-                       <dd><a href="mailto:{@$encodedEmailAddress}">{@$encodedEmailAddress}</a></dd>
+                       <dd><a href="mailto:{@$encodedUriEmailAddress}">{@$encodedEmailAddress}</a></dd>
                {/if}
                
                {if LEGAL_NOTICE_PHONE}