X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FUrl.php;h=6b9870f0c1bb468ebafd67e2d71123411f598a0c;hb=4fa9a3c5d83a1024678596a586afe5df14a345b5;hp=b37593773b920c26d3a9e5332d197dc17fb44449;hpb=5c6fac0bfc9583e6e372643facf6ddc50a6a1b1d;p=github%2Fshaarli%2FShaarli.git diff --git a/application/Url.php b/application/Url.php index b3759377..6b9870f0 100644 --- a/application/Url.php +++ b/application/Url.php @@ -81,7 +81,7 @@ function whitelist_protocols($url, $protocols) // Protocol not allowed: we remove it and replace it with http if ($protocol === 1 && ! in_array($match[1], $protocols)) { $url = str_replace($match[0], 'http://', $url); - } else if ($protocol !== 1) { + } elseif ($protocol !== 1) { $url = 'http://' . $url; } return $url; @@ -260,7 +260,7 @@ class Url if (! function_exists('idn_to_ascii') || ! isset($this->parts['host'])) { return $out; } - $asciiHost = idn_to_ascii($this->parts['host']); + $asciiHost = idn_to_ascii($this->parts['host'], 0, INTL_IDNA_VARIANT_UTS46); return str_replace($this->parts['host'], $asciiHost, $out); }