Skip to content
Snippets Groups Projects
Commit 7f03401d authored by Prasad's avatar Prasad
Browse files

Added XSS protection to jQuery prior to 3.x for cross-domain requestS

parent fadc0aab
No related branches found
No related tags found
No related merge requests found
......@@ -537,4 +537,20 @@ jQuery(function () {
modal_this.$element.focus()
}
})};
});
\ No newline at end of file
});
/**
* Pre-filter Ajax requests to guard against XSS attacks.
*
* See https://github.com/jquery/jquery/issues/2432
*/
if (jQuery.ajaxPrefilter) {
// For newer versions of jQuery, use an Ajax prefilter to prevent
// auto-executing script tags from untrusted domains. This is similar to the
// fix that is built in to jQuery 3.0 and higher.
jQuery.ajaxPrefilter(function (s) {
if (s.crossDomain) {
s.contents.script = false;
}
});
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment