mirror of
https://github.com/friendica/friendica
synced 2025-04-22 21:50:12 +00:00
Hash tag links now do a redir
This commit is contained in:
parent
f8946c9e0a
commit
17b05c9ad9
7 changed files with 33 additions and 15 deletions
|
@ -1315,6 +1315,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
|
|||
|
||||
// Always allowed protocol even if config isn't set or not including it
|
||||
$allowed_link_protocols[] = 'http';
|
||||
$allowed_link_protocols[] = 'redir/';
|
||||
|
||||
$regex = '#<([^>]*?)(href)="(?!' . implode('|', $allowed_link_protocols) . ')(.*?)"(.*?)>#ism';
|
||||
$Text = preg_replace($regex, '<$1$2="javascript:void(0)"$4 class="invalid-href" title="' . t('Invalid link protocol') . '">', $Text);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue