1 2function cookieadmin_pro_set_consent(prefrenc, days){ 3 4 const xhttp = new XMLHttpRequest(); 5 var data = 'action=cookieadmin_pro_ajax_handler&cookieadmin_act=save_consent&cookieadmin_pro_security=' + cookieadmin_pro_vars.nonce + '&cookieadmin_preference=' + encodeURIComponent(JSON.stringify(Object.keys(prefrenc))); 6 if(cookieadmin_is_obj(cookieadmin_is_consent) && !!cookieadmin_is_consent.consent){ 7 data += '&cookieadmin_consent_id=' + cookieadmin_is_consent.consent; 8 } 9 10 var consent_id = ""; 11 12 xhttp.open("POST", cookieadmin_pro_vars.ajax_url, false); 13 xhttp.onload = function() { 14 parsed = JSON.parse(this.responseText); 15 if(parsed.success){ 16 consent_id = parsed.data.response; 17 } 18 19 } 20 21 xhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 22 xhttp.send(data); 23 24 if(consent_id){ 25 return consent_id; 26 } 27 28 return false; 29 30}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.