From f00686c679426cab31895744639189ea7b80e72c Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sat, 26 Apr 2014 16:12:55 +0100 Subject: [PATCH] If we have GET QS params, add &crsf=xyz to end --- lib/ice-coder.js | 4 ++++ lib/ice-coder.min.js | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index a9e3b00..f45ca51 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1566,6 +1566,10 @@ var ICEcoder = { // Start running plugin intervals according to given specifics startPluginIntervals: function(plugRef,plugURL,plugTarget,plugTimer) { + // Add CSRF to URL if it has QS params + if (plugURL.indexOf("?") > -1) { + plugURL = plugURL+"&csrf="+top.ICEcoder.csrf; + } top.ICEcoder['plugTimer'+plugRef] = // This window instances ["_parent","_top","_self",""].indexOf(plugTarget) > -1 diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js index 3d2eb17..e6ea77b 100644 --- a/lib/ice-coder.min.js +++ b/lib/ice-coder.min.js @@ -65,10 +65,10 @@ c.exec(b))&&a.getCursor().ch>d.index+d[0].length;);(b=top.get("content").content farbtastic("picker","color");a&&top.get("picker").farbtastic.setColor(a)},drawCanvasImage:function(a){var b,c,d,e,f,g,m,h,k,n,p;b=top.get("canvasPicker").getContext("2d");c=new Image;c.src=a.src;c.onload=function(){top.get("canvasPicker").width=a.width;top.get("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height)};top.get("canvasPicker").onmousemove=function(a){d=a.pageX-this.offsetLeft;e=a.pageY-this.offsetTop;f=b.getImageData(d,e,1,1).data;g=f[0];m=f[1];h=f[2];k=g+","+m+","+h;n=top.ICEcoder.rgbToHex(g, m,h);top.get("rgbMouseXY").value=k;top.get("hexMouseXY").value="#"+n;top.get("hexMouseXY").style.backgroundColor=top.get("rgbMouseXY").style.backgroundColor="#"+n;p=128>g||128>m||128>h&&200>g&&200>m&&50Cancelled tasks');setTimeout(function(){top.ICEcoder.serverMessage()},2E3)},setPreviousFiles:function(){var a;a=top.ICEcoder.openFiles.join(",").replace(/\//g, "|").replace(/(\|\[NEW\])|(,\|\[NEW\])/g,"").replace(/(^,)|(,$)/g,"");""==a&&(a="CLEAR");top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+a+"&csrf="+top.ICEcoder.csrf)},autoOpenFiles:function(){if(0