mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2024-09-11 13:37:10 +03:00
Fix internal link detection
Links may also use mailto: or other schemes
This commit is contained in:
parent
4d5ce84db9
commit
045e6af1d5
@ -43,7 +43,7 @@ export class PluginPagesComponent implements OnDestroy, AfterViewInit {
|
||||
// Get the href attribute set by the dev, not the one calculated by JS to detect if it's a relative/external link
|
||||
const href = a.getAttribute('href')
|
||||
|
||||
if (a.target !== '_blank' && !href.match(/^https?:\/\//)) {
|
||||
if (a.target !== '_blank' && !href.startsWith('/')) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user