summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/functions2.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/functions2.php b/include/functions2.php
index 5b38f1840..6b6f5aa56 100644
--- a/include/functions2.php
+++ b/include/functions2.php
@@ -1776,6 +1776,16 @@
$url .= '/';
}
+ //convert IDNA hostname to punycode if possible
+ if (function_exists("idn_to_ascii")) {
+ $parts = parse_url($url);
+ if (mb_detect_encoding($parts['host']) != 'ASCII')
+ {
+ $parts['host'] = idn_to_ascii($parts['host']);
+ $url = build_url($parts);
+ }
+ }
+
if ($url != "http:///")
return $url;
else