diff options
Diffstat (limited to 'lib/lib_rss.php')
| -rw-r--r-- | lib/lib_rss.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php index dd0eb11f6..c06157164 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -62,7 +62,12 @@ function idn_to_puny($url) { $parts = parse_url($url); if (!empty($parts['host'])) { $idn = $parts['host']; - $puny = idn_to_ascii($idn); + // INTL_IDNA_VARIANT_UTS46 is defined starting in PHP 5.4 + if (defined('INTL_IDNA_VARIANT_UTS46')) { + $puny = idn_to_ascii($idn, 0, INTL_IDNA_VARIANT_UTS46); + } else { + $puny = idn_to_ascii($idn); + } $pos = strpos($url, $idn); if ($pos !== false) { return substr_replace($url, $puny, $pos, strlen($idn)); |
