mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-22 22:00:18 +00:00
fix #4756: markdown notes: allow any valid URL for a tags
As anchor elements cannot load things into the current browsing context and are not necessarily more dangerous to users compared to HTTP(S) links, which we allowed since adding markdown rendering in the first place. Allows adding short-cuts for virtual guest resources, like RDP or SSH links. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
b0c7069a10
commit
5cbbb9c44a
@ -34,6 +34,7 @@ Ext.define('Proxmox.Markdown', {
|
|||||||
let url = new URL(value, window.location.origin);
|
let url = new URL(value, window.location.origin);
|
||||||
if (
|
if (
|
||||||
_isHTTPLike(url.protocol) ||
|
_isHTTPLike(url.protocol) ||
|
||||||
|
node.tagName.toLowerCase() === 'a' ||
|
||||||
(node.tagName.toLowerCase() === 'img' && url.protocol.toLowerCase() === 'data:')
|
(node.tagName.toLowerCase() === 'img' && url.protocol.toLowerCase() === 'data:')
|
||||||
) {
|
) {
|
||||||
node.attributes[i].value = url.href;
|
node.attributes[i].value = url.href;
|
||||||
|
Loading…
Reference in New Issue
Block a user