Don't send csrf token with crossdomain requests

This commit is contained in:
Eric Schultz
2017-12-06 21:28:18 -06:00
parent 4745a49e01
commit b7f42f574a

View File

@@ -277,8 +277,9 @@ var device=navigator.platform.toLowerCase();
for (var i=0,mobile; mobile=mobiles[i]; i++) {
if (device.indexOf(mobile)>=0) {$('#footer').css('position','static'); break;}
}
$(document).ajaxSend(function(elm, xhr, s){
if (s.type == "POST") {
$.ajaxPrefilter(function(s, orig, xhr){
if (s.type == "post" && !s.crossDomain) {
s.data = s.data || "";
s.data += s.data?"&":"";
s.data += "csrf_token=<?=$var['csrf_token']?>";
}