diff options
| author | 2017-12-02 14:13:19 +0100 | |
|---|---|---|
| committer | 2017-12-02 14:13:19 +0100 | |
| commit | f71ad3f0822f3b3dd8d3bf911e0e23977244a3b3 (patch) | |
| tree | 83978095ec7400d6aa4d54dd775f72d2c6113328 /lib/lib_rss.php | |
| parent | e16a20c8925c5aaf737e94f45ebf5a0508f108de (diff) | |
| parent | 7490dfdc42654c347cd8cd20b873c71b0e030fd8 (diff) | |
Merge branch 'dev' of https://github.com/FreshRSS/FreshRSS into FreshRSS/dev
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)); |
