mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Sanitize: do not escape forward slash (#65416)
This commit is contained in:
parent
09ff5ab522
commit
420aeb3bec
@ -85,6 +85,5 @@ export function escapeHtml(str: string): string {
|
|||||||
.replace(/</g, '<')
|
.replace(/</g, '<')
|
||||||
.replace(/>/g, '>')
|
.replace(/>/g, '>')
|
||||||
.replace(/'/g, ''')
|
.replace(/'/g, ''')
|
||||||
.replace(/\//g, '/')
|
|
||||||
.replace(/"/g, '"');
|
.replace(/"/g, '"');
|
||||||
}
|
}
|
||||||
|
@ -420,7 +420,7 @@ describe('templateSrv', () => {
|
|||||||
{ type: 'query', name: 'test', current: { value: '<script>alert(asd)</script>' } },
|
{ type: 'query', name: 'test', current: { value: '<script>alert(asd)</script>' } },
|
||||||
]);
|
]);
|
||||||
const target = _templateSrv.replace('$test', {}, 'html');
|
const target = _templateSrv.replace('$test', {}, 'html');
|
||||||
expect(target).toBe('<script>alert(asd)</script>');
|
expect(target).toBe('<script>alert(asd)</script>');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user