]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/http/UrlUtils.php
Add an exception to method 'whitelist_protocols' for url which started with '#'
[github/shaarli/Shaarli.git] / application / http / UrlUtils.php
index 4bc84b823d7ce8d3d44dec028facb6ab28610aed..e8d1a283fca632ecce9af242f8676c7f824015a4 100644 (file)
@@ -73,7 +73,7 @@ function add_trailing_slash($url)
  */
 function whitelist_protocols($url, $protocols)
 {
-    if (startsWith($url, '?') || startsWith($url, '/')) {
+    if (startsWith($url, '?') || startsWith($url, '/') || startsWith($url, '#')) {
         return $url;
     }
     $protocols = array_merge(['http', 'https'], $protocols);