From 1cc5c0712965704a584e0a5907c2320e1a82653a Mon Sep 17 00:00:00 2001 From: Leo Feyer Date: Thu, 15 Aug 2013 11:41:29 +0200 Subject: [PATCH] Decode IDNA domains in any system mail (see #5932) --- contao/modules/ModuleSubscribe.php | 6 +++--- contao/modules/ModuleUnsubscribe.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contao/modules/ModuleSubscribe.php b/contao/modules/ModuleSubscribe.php index b4f7dd5a2c..88a9f079c0 100644 --- a/contao/modules/ModuleSubscribe.php +++ b/contao/modules/ModuleSubscribe.php @@ -275,15 +275,15 @@ protected function addRecipient() // Prepare the e-mail text $strText = str_replace('##token##', $strToken, $this->nl_subscribe); - $strText = str_replace('##domain##', \Environment::get('host'), $strText); - $strText = str_replace('##link##', \Environment::get('base') . \Environment::get('request') . (($GLOBALS['TL_CONFIG']['disableAlias'] || strpos(\Environment::get('request'), '?') !== false) ? '&' : '?') . 'token=' . $strToken, $strText); + $strText = str_replace('##domain##', \Idna::decode(\Environment::get('host')), $strText); + $strText = str_replace('##link##', \Idna::decode(\Environment::get('base')) . \Environment::get('request') . (($GLOBALS['TL_CONFIG']['disableAlias'] || strpos(\Environment::get('request'), '?') !== false) ? '&' : '?') . 'token=' . $strToken, $strText); $strText = str_replace(array('##channel##', '##channels##'), implode("\n", $objChannel->fetchEach('title')), $strText); // Activation e-mail $objEmail = new \Email(); $objEmail->from = $GLOBALS['TL_ADMIN_EMAIL']; $objEmail->fromName = $GLOBALS['TL_ADMIN_NAME']; - $objEmail->subject = sprintf($GLOBALS['TL_LANG']['MSC']['nl_subject'], \Environment::get('host')); + $objEmail->subject = sprintf($GLOBALS['TL_LANG']['MSC']['nl_subject'], \Idna::decode(\Environment::get('host'))); $objEmail->text = $strText; $objEmail->sendTo($varInput); diff --git a/contao/modules/ModuleUnsubscribe.php b/contao/modules/ModuleUnsubscribe.php index 2756a53f95..6024d621f4 100644 --- a/contao/modules/ModuleUnsubscribe.php +++ b/contao/modules/ModuleUnsubscribe.php @@ -204,14 +204,14 @@ protected function removeRecipient() } // Prepare the e-mail text - $strText = str_replace('##domain##', \Environment::get('host'), $this->nl_unsubscribe); + $strText = str_replace('##domain##', \Idna::decode(\Environment::get('host')), $this->nl_unsubscribe); $strText = str_replace(array('##channel##', '##channels##'), implode("\n", $arrChannels), $strText); // Confirmation e-mail $objEmail = new \Email(); $objEmail->from = $GLOBALS['TL_ADMIN_EMAIL']; $objEmail->fromName = $GLOBALS['TL_ADMIN_NAME']; - $objEmail->subject = sprintf($GLOBALS['TL_LANG']['MSC']['nl_subject'], \Environment::get('host')); + $objEmail->subject = sprintf($GLOBALS['TL_LANG']['MSC']['nl_subject'], \Idna::decode(\Environment::get('host'))); $objEmail->text = $strText; $objEmail->sendTo($varInput);