Changeset 2490921
- Timestamp:
- 03/09/2021 06:26:21 PM (5 years ago)
- Location:
- consent-manager/trunk
- Files:
-
- 3 edited
-
ConsentManagerMain.php (modified) (1 diff)
-
consentmanager.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
consent-manager/trunk/ConsentManagerMain.php
r2333607 r2490921 15 15 16 16 public function checkId($id){ 17 if(strlen($id) > 32){ 18 return false; 17 if((int)$id > 0){ 18 return true; 19 } else { 20 return false; 19 21 } 20 if(!preg_match('/^[0-9a-z]+$/', $id)){21 return false;22 }23 return true;24 22 } 25 23 26 24 static function getHTML($id){ 27 return '<script>window.gdprAppliesGlobally=false;window.cmp_id='. $id.';window.cmp_params="";window.cmp_host="consentmanager.mgr.consensu.org";window.cmp_cdn="cdn.consentmanager.mgr.consensu.org";function cmp_getlang(j){if(typeof(j)!="boolean"){j=true}if(j&&typeof(cmp_getlang.usedlang)=="string"&&cmp_getlang.usedlang!==""){return cmp_getlang.usedlang}var g=["DE","EN","FR","IT","NO","DA","FI","ES","PT","RO","BG","ET","EL","GA","HR","LV","LT","MT","NL","PL","SV","SK","SL","CS","HU","RU","SR","ZH"];var c=[];var f=location.hash;var e=location.search;var a="languages" in navigator?navigator.languages:[];if(f.indexOf("cmplang=")!=-1){c.push(f.substr(f.indexOf("cmplang=")+8,2))}else{if(e.indexOf("cmplang=")!=-1){c.push(e.substr(e.indexOf("cmplang=")+8,2))}else{if("cmp_setlang" in window&&window.cmp_setlang!=""){c.push(window.cmp_setlang.toUpperCase())}else{if(a.length>0){for(var d=0;d<a.length;d++){c.push(a[d])}}}}}if("language" in navigator){c.push(navigator.language)}if("userLanguage" in navigator){c.push(navigator.userLanguage)}var h="";for(var d=0;d<c.length;d++){var b=c[d].toUpperCase();if(b.indexOf("-")!=-1){b=b.substr(0,2)}if(g.indexOf(b)!=-1){h=b;break}}if(h==""){h="EN"}h=h.toUpperCase();return h}(function(){var a="";var c="_en";if("cmp_getlang" in window){a=window.cmp_getlang().toLowerCase();c="_"+a}var b=document.createElement("script");b.src="https://"+window.cmp_host+"/delivery/cmp.php?id="+window.cmp_id+"&h="+encodeURIComponent(location.href)+"&"+window.cmp_params+(document.cookie.length>0?"&__cmpfcc=1":"")+"&l="+a+"&o="+(new Date()).getTime();b.type="text/javascript";b.setAttribute("data-cmp-ab",1);b.async=true;if(document.body){document.body.appendChild(b)}else{if(document.currentScript){document.currentScript.parentElement.appendChild(b)}else{document.write(b.outerHTML)}}var b=document.createElement("script");b.src="https://"+window.cmp_cdn+"/delivery/cmp"+c+".min.js";b.type="text/javascript";b.setAttribute("data-cmp-ab",1);b.async=true;if(document.body){document.body.appendChild(b)}else{if(document.currentScript){document.currentScript.parentElement.appendChild(b)}else{document.write(b.outerHTML)}}window.cmp_addFrame=function(e){if(!window.frames[e]){if(document.body){var d=document.createElement("iframe");d.style.cssText="display:none";d.name=e;document.body.appendChild(d)}else{window.setTimeout(\'window.cmp_addFrame("\'+e+\'")\',10)}}};window.cmp_rc=function(j){var d=document.cookie;var g="";var f=0;while(d!=""&&f<100){f++;while(d.substr(0,1)==" "){d=d.substr(1,d.length)}var h=d.substring(0,d.indexOf("="));if(d.indexOf(";")!=-1){var e=d.substring(d.indexOf("=")+1,d.indexOf(";"))}else{var e=d.substr(d.indexOf("=")+1,d.length)}if(j==h){g=e}i=d.indexOf(";")+1;if(i==0){i=d.length}d=d.substring(i,d.length)}return(g)};window.cmp_stub=function(){var d=arguments;__cmp.a=__cmp.a||[];if(!d.length){return __cmp.a}else{if(d[0]==="ping"){if(d[1]===2){d[2]({gdprApplies:gdprAppliesGlobally,cmpLoaded:false,cmpStatus:"stub",displayStatus:"hidden",apiVersion:"2.0",cmpId:31},true)}else{d[2]({gdprAppliesGlobally:gdprAppliesGlobally,cmpLoaded:false},true)}}else{if(d[0]==="getUSPData"){d[2]({version:1,uspString:window.cmp_rc("")},true)}else{if(d[0]==="getTCData"){__cmp.a.push([].slice.apply(d))}else{if(d.length==4&&d[3]===false){d[2]({},false)}else{__cmp.a.push([].slice.apply(d))}}}}}};window.cmp_msghandler=function(h){var d=typeof h.data==="string";try{var g=d?JSON.parse(h.data):h.data}catch(j){var g=null}if(typeof(g)==="object"&&g!==null&&"__cmpCall" in g){var f=g.__cmpCall;window.__cmp(f.command,f.parameter,function(l,k){var e={__cmpReturn:{returnValue:l,success:k,callId:f.callId}};h.source.postMessage(d?JSON.stringify(e):e,"*")})}if(typeof(g)==="object"&&g!==null&&"__uspapiCall" in g){var f=g.__uspapiCall;window.__uspapi(f.command,f.version,function(l,k){var e={__uspapiReturn:{returnValue:l,success:k,callId:f.callId}};h.source.postMessage(d?JSON.stringify(e):e,"*")})}if(typeof(g)==="object"&&g!==null&&"__tcfapiCall" in g){var f=g.__tcfapiCall;window.__tcfapi(f.command,f.version,function(l,k){var e={__tcfapiReturn:{returnValue:l,success:k,callId:f.callId}};h.source.postMessage(d?JSON.stringify(e):e,"*")},f.parameter)}};window.cmp_setStub=function(d){if(!(d in window)||(typeof(window[d])!=="function"&&typeof(window[d])!=="object"&&(typeof(window[d])==="undefined"||window[d]!==null))){window[d]=window.cmp_stub;window[d].msgHandler=window.cmp_msghandler;if(window.addEventListener){window.addEventListener("message",window.cmp_msghandler,false)}else{window.attachEvent("onmessage",window.cmp_msghandler)}}};window.cmp_addFrame("__cmpLocator");window.cmp_addFrame("__uspapiLocator");window.cmp_addFrame("__tcfapiLocator");window.cmp_setStub("__cmp");window.cmp_setStub("__tcfapi");window.cmp_setStub("__uspapi")})();</script>';25 return '<script>window.gdprAppliesGlobally=false;window.cmp_id='.(int)$id.';window.cmp_params="";window.cmp_host="consentmanager.mgr.consensu.org";window.cmp_cdn="cdn.consentmanager.mgr.consensu.org";function cmp_getlang(j){if(typeof(j)!="boolean"){j=true}if(j&&typeof(cmp_getlang.usedlang)=="string"&&cmp_getlang.usedlang!==""){return cmp_getlang.usedlang}var g=["DE","EN","FR","IT","NO","DA","FI","ES","PT","RO","BG","ET","EL","GA","HR","LV","LT","MT","NL","PL","SV","SK","SL","CS","HU","RU","SR","ZH"];var c=[];var f=location.hash;var e=location.search;var a="languages" in navigator?navigator.languages:[];if(f.indexOf("cmplang=")!=-1){c.push(f.substr(f.indexOf("cmplang=")+8,2))}else{if(e.indexOf("cmplang=")!=-1){c.push(e.substr(e.indexOf("cmplang=")+8,2))}else{if("cmp_setlang" in window&&window.cmp_setlang!=""){c.push(window.cmp_setlang.toUpperCase())}else{if(a.length>0){for(var d=0;d<a.length;d++){c.push(a[d])}}}}}if("language" in navigator){c.push(navigator.language)}if("userLanguage" in navigator){c.push(navigator.userLanguage)}var h="";for(var d=0;d<c.length;d++){var b=c[d].toUpperCase();if(b.indexOf("-")!=-1){b=b.substr(0,2)}if(g.indexOf(b)!=-1){h=b;break}}if(h==""){h="EN"}h=h.toUpperCase();return h}(function(){var a="";var c="_en";if("cmp_getlang" in window){a=window.cmp_getlang().toLowerCase();c="_"+a}var b=document.createElement("script");b.src="https://"+window.cmp_host+"/delivery/cmp.php?id="+window.cmp_id+"&h="+encodeURIComponent(location.href)+"&"+window.cmp_params+(document.cookie.length>0?"&__cmpfcc=1":"")+"&l="+a+"&o="+(new Date()).getTime();b.type="text/javascript";b.setAttribute("data-cmp-ab",1);b.async=true;if(document.body){document.body.appendChild(b)}else{if(document.currentScript){document.currentScript.parentElement.appendChild(b)}else{document.write(b.outerHTML)}}var b=document.createElement("script");b.src="https://"+window.cmp_cdn+"/delivery/cmp"+c+".min.js";b.type="text/javascript";b.setAttribute("data-cmp-ab",1);b.async=true;if(document.body){document.body.appendChild(b)}else{if(document.currentScript){document.currentScript.parentElement.appendChild(b)}else{document.write(b.outerHTML)}}window.cmp_addFrame=function(e){if(!window.frames[e]){if(document.body){var d=document.createElement("iframe");d.style.cssText="display:none";d.name=e;document.body.appendChild(d)}else{window.setTimeout(\'window.cmp_addFrame("\'+e+\'")\',10)}}};window.cmp_rc=function(j){var d=document.cookie;var g="";var f=0;while(d!=""&&f<100){f++;while(d.substr(0,1)==" "){d=d.substr(1,d.length)}var h=d.substring(0,d.indexOf("="));if(d.indexOf(";")!=-1){var e=d.substring(d.indexOf("=")+1,d.indexOf(";"))}else{var e=d.substr(d.indexOf("=")+1,d.length)}if(j==h){g=e}i=d.indexOf(";")+1;if(i==0){i=d.length}d=d.substring(i,d.length)}return(g)};window.cmp_stub=function(){var d=arguments;__cmp.a=__cmp.a||[];if(!d.length){return __cmp.a}else{if(d[0]==="ping"){if(d[1]===2){d[2]({gdprApplies:gdprAppliesGlobally,cmpLoaded:false,cmpStatus:"stub",displayStatus:"hidden",apiVersion:"2.0",cmpId:31},true)}else{d[2]({gdprAppliesGlobally:gdprAppliesGlobally,cmpLoaded:false},true)}}else{if(d[0]==="getUSPData"){d[2]({version:1,uspString:window.cmp_rc("")},true)}else{if(d[0]==="getTCData"){__cmp.a.push([].slice.apply(d))}else{if(d.length==4&&d[3]===false){d[2]({},false)}else{__cmp.a.push([].slice.apply(d))}}}}}};window.cmp_msghandler=function(h){var d=typeof h.data==="string";try{var g=d?JSON.parse(h.data):h.data}catch(j){var g=null}if(typeof(g)==="object"&&g!==null&&"__cmpCall" in g){var f=g.__cmpCall;window.__cmp(f.command,f.parameter,function(l,k){var e={__cmpReturn:{returnValue:l,success:k,callId:f.callId}};h.source.postMessage(d?JSON.stringify(e):e,"*")})}if(typeof(g)==="object"&&g!==null&&"__uspapiCall" in g){var f=g.__uspapiCall;window.__uspapi(f.command,f.version,function(l,k){var e={__uspapiReturn:{returnValue:l,success:k,callId:f.callId}};h.source.postMessage(d?JSON.stringify(e):e,"*")})}if(typeof(g)==="object"&&g!==null&&"__tcfapiCall" in g){var f=g.__tcfapiCall;window.__tcfapi(f.command,f.version,function(l,k){var e={__tcfapiReturn:{returnValue:l,success:k,callId:f.callId}};h.source.postMessage(d?JSON.stringify(e):e,"*")},f.parameter)}};window.cmp_setStub=function(d){if(!(d in window)||(typeof(window[d])!=="function"&&typeof(window[d])!=="object"&&(typeof(window[d])==="undefined"||window[d]!==null))){window[d]=window.cmp_stub;window[d].msgHandler=window.cmp_msghandler;if(window.addEventListener){window.addEventListener("message",window.cmp_msghandler,false)}else{window.attachEvent("onmessage",window.cmp_msghandler)}}};window.cmp_addFrame("__cmpLocator");window.cmp_addFrame("__uspapiLocator");window.cmp_addFrame("__tcfapiLocator");window.cmp_setStub("__cmp");window.cmp_setStub("__tcfapi");window.cmp_setStub("__uspapi")})();</script>'; 28 26 } 29 27 -
consent-manager/trunk/consentmanager.php
r2214414 r2490921 31 31 $id = esc_attr( get_option(consentManagerMain::OPTION_ID) ); 32 32 }catch(Exception $e){} 33 if( isset($id) && $id != ''){33 if((int)$id > 0){ 34 34 consent_manager_scripts(); 35 35 consent_manager_style(); 36 echo ConsentManagerMain::getHTML( $id);36 echo ConsentManagerMain::getHTML((int)$id); 37 37 } 38 38 } -
consent-manager/trunk/readme.txt
r2488083 r2490921 5 5 Requires at least: 3.0 6 6 Tested up to: 5.7 7 Stable tag: trunk7 Stable tag: 1.1.0 8 8 Requires PHP: 5.2.4 9 9 License: GPLv2
Note: See TracChangeset
for help on using the changeset viewer.