From: Tim Düsterhus Date: Tue, 19 Sep 2023 09:03:28 +0000 (+0200) Subject: Make use of Mailbox::getAddressForMailto() X-Git-Tag: 6.0.0_RC_2~1^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4ec242908f9d3278bd04ad9997367caf6d01b7d3;p=GitHub%2FWoltLab%2Fcom.woltlab.wcf.legalNotice.git Make use of Mailbox::getAddressForMailto() see WoltLab/WCF#5660 --- diff --git a/files/lib/page/LegalNoticePage.class.php b/files/lib/page/LegalNoticePage.class.php index 3801667..6c7a65e 100644 --- a/files/lib/page/LegalNoticePage.class.php +++ b/files/lib/page/LegalNoticePage.class.php @@ -2,6 +2,7 @@ namespace wcf\page; +use wcf\system\email\Mailbox; use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\StringUtil; @@ -10,7 +11,7 @@ use wcf\util\StringUtil; * Shows the legal notice page. * * @author Marcel Werk - * @copyright 2001-2022 WoltLab GmbH + * @copyright 2001-2023 WoltLab GmbH * @license GNU Lesser General Public License */ final class LegalNoticePage extends AbstractPage @@ -34,9 +35,16 @@ final class LegalNoticePage extends AbstractPage { parent::assignVariables(); + try { + $uri = (new Mailbox(LEGAL_NOTICE_EMAIL_ADDRESS)) + ->getAddressForMailto(); + } catch (\DomainException) { + $uri = LEGAL_NOTICE_EMAIL_ADDRESS; + } + WCF::getTPL()->assign([ 'encodedEmailAddress' => StringUtil::encodeAllChars(LEGAL_NOTICE_EMAIL_ADDRESS), - 'encodedUriEmailAddress' => StringUtil::encodeAllChars(\rawurlencode(LEGAL_NOTICE_EMAIL_ADDRESS)), + 'encodedUriEmailAddress' => StringUtil::encodeAllChars($uri), ]); } }