aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/http/UrlUtils.php
diff options
context:
space:
mode:
authoraguy <aguytech@users.noreply.github.com>2020-02-28 15:14:22 +0000
committerGitHub <noreply@github.com>2020-02-28 15:14:22 +0000
commit424530d9afbee2b2ba0d9b80679fbd0e4ec2d4e2 (patch)
treee04430d1719ead95f574bb739b894a88b6251eee /application/http/UrlUtils.php
parent810f0f6c96b6d26e22164027185c5996b425816c (diff)
downloadShaarli-424530d9afbee2b2ba0d9b80679fbd0e4ec2d4e2.tar.gz
Shaarli-424530d9afbee2b2ba0d9b80679fbd0e4ec2d4e2.tar.zst
Shaarli-424530d9afbee2b2ba0d9b80679fbd0e4ec2d4e2.zip
Add an exception to method 'whitelist_protocols' for url which started with '#'
This is to allow local link for markdown, actually a local link write with this syntax : '[anchor](#local_link)' produce this html code: http://#local_link
Diffstat (limited to 'application/http/UrlUtils.php')
-rw-r--r--application/http/UrlUtils.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/application/http/UrlUtils.php b/application/http/UrlUtils.php
index 4bc84b82..e8d1a283 100644
--- a/application/http/UrlUtils.php
+++ b/application/http/UrlUtils.php
@@ -73,7 +73,7 @@ function add_trailing_slash($url)
73 */ 73 */
74function whitelist_protocols($url, $protocols) 74function whitelist_protocols($url, $protocols)
75{ 75{
76 if (startsWith($url, '?') || startsWith($url, '/')) { 76 if (startsWith($url, '?') || startsWith($url, '/') || startsWith($url, '#')) {
77 return $url; 77 return $url;
78 } 78 }
79 $protocols = array_merge(['http', 'https'], $protocols); 79 $protocols = array_merge(['http', 'https'], $protocols);