mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
JavaScript: Improve XSS sanitizer detection.
We now use local data flow to detect more regexp-based sanitizers.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
function escapeHtml(s) {
|
||||
var amp = /&/g, lt = /</g, gt = />/g;
|
||||
return s.toString()
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
.replace(amp, '&')
|
||||
.replace(lt, '<')
|
||||
.replace(gt, '>');
|
||||
}
|
||||
|
||||
function escapeAttr(s) {
|
||||
|
||||
Reference in New Issue
Block a user