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
This commit is contained in:
parent
810f0f6c96
commit
424530d9af
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue