aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CREDITS.md1
-rw-r--r--lib/lib_rss.php7
2 files changed, 7 insertions, 1 deletions
diff --git a/CREDITS.md b/CREDITS.md
index 605a2ff07..afe4b13b2 100644
--- a/CREDITS.md
+++ b/CREDITS.md
@@ -13,6 +13,7 @@ People are sorted by name so please keep this order.
* [Amaury Carrade](https://github.com/AmauryCarrade): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=AmauryCarrade), [Web](https://amaury.carrade.eu/)
* [Anton Smirnov](https://github.com/sandfoxme): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:sandfoxme), [Web](http://sandfox.me/)
* [ASMfreaK](https://github.com/ASMfreaK): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=ASMfreaK)
+* [Craig Andrews](https://github.com/candrews): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:candrews), [Web](http://candrews.integralblue.com/)
* [Crupuk](https://github.com/Crupuk): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:Crupuk)
* [Damstre](https://github.com/Damstre): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:Damstre)
* [danc](https://github.com/danc): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=danc), [Web](http://tintouli.free.fr/)
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));