aboutsummaryrefslogtreecommitdiff
path: root/lib/lib_rss.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-12-02 14:10:09 +0100
committerGravatar GitHub <noreply@github.com> 2017-12-02 14:10:09 +0100
commit7490dfdc42654c347cd8cd20b873c71b0e030fd8 (patch)
tree9f9ed8895e7f9aa411942a129f1b2827c5ac0539 /lib/lib_rss.php
parente719cf85282f2c971adaaba7902ad23cfab73762 (diff)
parent3814dd6613f5525d62a407de11f9edbcf76f0e83 (diff)
Merge pull request #1700 from candrews/patch-1
Call idn_to_ascii with INTL_IDNA_VARIANT_UTS46
Diffstat (limited to 'lib/lib_rss.php')
-rw-r--r--lib/lib_rss.php7
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));