diff options
| author | 2017-12-02 14:10:09 +0100 | |
|---|---|---|
| committer | 2017-12-02 14:10:09 +0100 | |
| commit | 7490dfdc42654c347cd8cd20b873c71b0e030fd8 (patch) | |
| tree | 9f9ed8895e7f9aa411942a129f1b2827c5ac0539 /lib | |
| parent | e719cf85282f2c971adaaba7902ad23cfab73762 (diff) | |
| parent | 3814dd6613f5525d62a407de11f9edbcf76f0e83 (diff) | |
Merge pull request #1700 from candrews/patch-1
Call idn_to_ascii with INTL_IDNA_VARIANT_UTS46
Diffstat (limited to 'lib')
| -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)); |
