Browse code

Ermögliche die Verwendung von erweiterten Zeichen (z.B. im Domainnamen)

Bernd Wurst authored on22/12/2017 07:39:52
Showing3 changed files
... ...
@@ -103,7 +103,7 @@ function __ensure_connected()
103 103
     try {
104 104
       DEBUG("Neue Datenbankverbindung!");
105 105
       $_db = new DB();
106
-      $_db->query("SET NAMES utf8");
106
+      $_db->query("SET NAMES utf8mb4");
107 107
       $_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
108 108
       $_db->setAttribute(PDO::ATTR_AUTOCOMMIT, true);
109 109
     } catch (PDOException $e) {
... ...
@@ -395,7 +395,7 @@ $tld_ns = array();
395 395
 
396 396
 function check_dns($domainname, $tld) {
397 397
   global $tld_ns;
398
-  $domain=idn_to_ascii($domainname.".".$tld);
398
+  $domain=idn_to_ascii($domainname.".".$tld, 0, INTL_IDNA_VARIANT_UTS46);
399 399
 
400 400
   if (! isset($tld_ns[$tld])) {
401 401
     $resp = shell_exec('dig @a.root-servers.net. +noall +authority -t ns '.$tld.'.');
... ...
@@ -34,7 +34,7 @@ if (!preg_match('/((daily_|hourly_|ctry_)?(usage|agent|search|ref|url|site)(_[0-
34 34
   system_failure("Ungültiger Dateiname: »".filter_input_general($_REQUEST['file'])."«");
35 35
 }
36 36
 
37
-$path = '/home/stats/webalizer/data/' . idn_to_ascii($vhost['fqdn']);
37
+$path = '/home/stats/webalizer/data/' . idn_to_ascii($vhost['fqdn'], 0, INTL_IDNA_VARIANT_UTS46);
38 38
 $file = $path . '/' . $_REQUEST['file'];
39 39
 
40 40
 if ( is_file($file) )