]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/Url.php
Fix a JS bug preventing AJAX tag deletion to work
[github/shaarli/Shaarli.git] / application / Url.php
index b37593773b920c26d3a9e5332d197dc17fb44449..6b9870f0c1bb468ebafd67e2d71123411f598a0c 100644 (file)
@@ -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);
     }