Browse code

Punycode-Konvertierung findet in der Domain-Klasse statt

Bernd Wurst authored on09/01/2018 05:42:48
Showing2 changed files
... ...
@@ -83,6 +83,8 @@ class Domain extends KeksData
83 83
       if (array_key_exists($key, $data))
84 84
         $this->data[$key] = $data[$key];
85 85
     $this->data['fqdn'] = $data['domainname'].'.'.$data['tld'];
86
+    $this->data['punycode'] = idn_to_ascii($this->data['fqdn'], 0, INTL_IDNA_VARIANT_UTS46);
87
+    $this->data['is_idn'] = ($this->data['fqdn'] != $this->data['punycode']);
86 88
     $this->data['reg_date'] = $data['registrierungsdatum'];
87 89
     $this->data['cancel_date'] = $data['kuendigungsdatum'];
88 90
   }
... ...
@@ -68,8 +68,8 @@ foreach ($user_domains as $domain)
68 68
   $features = implode(', ', $features);
69 69
   if (! $features)
70 70
     $features = '<em>unbenutzt</em>';
71
-  $punycode = idn_to_ascii($domain->fqdn, 0, INTL_IDNA_VARIANT_UTS46);
72
-  if ($punycode != $domain->fqdn) {
71
+  $punycode = $domain->punycode;
72
+  if ($domain->is_idn) {
73 73
     $punycode = "<br/>($punycode)";
74 74
   } else {
75 75
     $punycode = '';