From a11a3106e2ce1196fb0b06d28e1dbb4a19a46c67 Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Fri, 31 Jul 2020 14:10:16 +0200
Subject: [PATCH] - fixed idn encoded domains on dashlets

---
 interface/web/dashboard/dashlets/mailquota.php |  6 +++++-
 interface/web/dashboard/dashlets/quota.php     | 11 ++++++++---
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/interface/web/dashboard/dashlets/mailquota.php b/interface/web/dashboard/dashlets/mailquota.php
index 4629d6a463..a9434e58ea 100644
--- a/interface/web/dashboard/dashlets/mailquota.php
+++ b/interface/web/dashboard/dashlets/mailquota.php
@@ -21,13 +21,17 @@ class dashlet_mailquota {
 
 		$has_mailquota = false;
 		if(is_array($emails) && !empty($emails)){
+			foreach($emails as &$email) {
+				$email['email'] = $app->functions->idn_decode($email['email']);
+			}
+			unset($email);
 			// email username is quoted in quota.lib already, so no htmlentities here to prevent double encoding
 			//$emails = $app->functions->htmlentities($emails);
 			$tpl->setloop('mailquota', $emails);
 			$has_mailquota = isset($emails[0]['used']);
 		}
 		$tpl->setVar('has_mailquota', $has_mailquota);
-		
+
 		return $tpl->grab();
 	}
 
diff --git a/interface/web/dashboard/dashlets/quota.php b/interface/web/dashboard/dashlets/quota.php
index dfb82d5c24..3fd5adbb85 100644
--- a/interface/web/dashboard/dashlets/quota.php
+++ b/interface/web/dashboard/dashlets/quota.php
@@ -7,9 +7,9 @@ class dashlet_quota {
 
 		//* Loading Template
 		$app->uses('tpl,quota_lib');
-               if (!$app->auth->verify_module_permissions('sites')) {
-                       return;
-               }
+		if (!$app->auth->verify_module_permissions('sites')) {
+				return;
+		}
 
 		$tpl = new tpl;
 		$tpl->newTemplate("dashlets/templates/quota.htm");
@@ -24,6 +24,11 @@ class dashlet_quota {
 
 		$has_quota = false;
 		if(is_array($sites) && !empty($sites)){
+			foreach($sites as &$site) {
+				$site['domain'] = $app->functions->idn_decode($site['domain']);
+			}
+			unset($site);
+
 			$sites = $app->functions->htmlentities($sites);
 			$tpl->setloop('quota', $sites);
 			$has_quota = isset($sites[0]['used']);
-- 
GitLab