diff --git a/lib/ice-coder.js b/lib/ice-coder.js
index 63a21fd..2761d8a 100644
--- a/lib/ice-coder.js
+++ b/lib/ice-coder.js
@@ -1879,7 +1879,7 @@ var ICEcoder = {
newFolder = top.ICEcoder.getInput('Enter new folder name at '+shortURL,'');
if (newFolder) {
newFolder = (shortURL + "/" + newFolder).replace(/\/\//,"/");
- top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=newFolder&csrf="+top.ICEcoder.csrf,newFolder.replace(/\//g,"|").replace(/\+/g,"%2B"));
+ top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=newFolder&csrf="+top.ICEcoder.csrf,encodeURIComponent(newFolder.replace(/\//g,"|")));
top.ICEcoder.serverMessage(''+top.t['Creating Folder']+'
'+newFolder);
}
},
@@ -1946,7 +1946,7 @@ var ICEcoder = {
if (shortURL!="/[NEW]") {
top.ICEcoder.thisFileFolderLink = top.ICEcoder.thisFileFolderLink.replace(/\//g,"|");
- top.ICEcoder.serverQueue("add","lib/file-control.php?action=load&file="+top.ICEcoder.thisFileFolderLink.replace(/\+/g,"%2B")+"&csrf="+top.ICEcoder.csrf+"&lineNumber="+line);
+ top.ICEcoder.serverQueue("add","lib/file-control.php?action=load&file="+encodeURIComponent(top.ICEcoder.thisFileFolderLink)+"&csrf="+top.ICEcoder.csrf+"&lineNumber="+line);
top.ICEcoder.serverMessage(''+top.t['Opening File']+'
'+top.ICEcoder.shortURL);
} else {
top.ICEcoder.createNewTab('new');
@@ -1986,7 +1986,7 @@ var ICEcoder = {
line = flSplit[1];
}
- top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=getRemoteFile&csrf="+top.ICEcoder.csrf+"&lineNumber="+line,remoteFile.replace(/\+/g,"%2B"));
+ top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=getRemoteFile&csrf="+top.ICEcoder.csrf+"&lineNumber="+line,encodeURIComponent(remoteFile));
top.ICEcoder.serverMessage(''+top.t['Getting']+'
'+remoteFile);
},
@@ -2049,7 +2049,7 @@ var ICEcoder = {
: "|[NEW]";
}
filePath = filePath.replace("||","|");
- top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=save&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&fileVersion="+ICEcoder.openFileVersions[ICEcoder.selectedTab-1]+"&saveType="+saveType+"&csrf="+top.ICEcoder.csrf,filePath.replace(/\+/g,"%2B"),changes);
+ top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=save&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&fileVersion="+ICEcoder.openFileVersions[ICEcoder.selectedTab-1]+"&saveType="+saveType+"&csrf="+top.ICEcoder.csrf,encodeURIComponent(filePath),changes);
top.ICEcoder.serverMessage(''+top.t['Saving']+'
'+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""));
},
@@ -2076,7 +2076,7 @@ var ICEcoder = {
top.get('tab'+(i+1)).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
top.get('tab'+(i+1)).title = newName;
}
- top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=rename&oldFileName="+oldName.replace(/\|/g,"/").replace(/\+/g,"%2B")+"&csrf="+top.ICEcoder.csrf,newName.replace(/\+/g,"%2B"));
+ top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=rename&oldFileName="+encodeURIComponent(oldName.replace(/\|/g,"/"))+"&csrf="+top.ICEcoder.csrf,encodeURIComponent(newName));
top.ICEcoder.serverMessage(''+top.t['Renaming to']+'
'+newName);
top.ICEcoder.setPreviousFiles();
@@ -2098,7 +2098,7 @@ var ICEcoder = {
top.get('tab'+(i+1)).title = newName;
}
if (top.ICEcoder.ask("Are you sure you want to move file " + oldName + " to " + newName + " ?")){
- top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=move&oldFileName="+oldName.replace(/\//g,"|").replace(/\+/g,"%2B")+"&csrf="+top.ICEcoder.csrf,newName.replace(/\//g,"|").replace(/\+/g,"%2B"));
+ top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=move&oldFileName="+encodeURIComponent(oldName.replace(/\//g,"|"))+"&csrf="+top.ICEcoder.csrf,encodeURIComponent(newName.replace(/\//g,"|")));
top.ICEcoder.serverMessage(''+top.t['Moving to']+'
'+newName);
}
@@ -2113,7 +2113,7 @@ var ICEcoder = {
tgtFiles = fileList ? fileList : top.ICEcoder.selectedFiles;
tgtListDisplay = tgtFiles.toString().replace(/\|/g,"/").replace(/,/g,"\n");
if (tgtFiles.length>0 && top.ICEcoder.ask('Delete:\n\n'+tgtListDisplay+'?')) {
- top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=delete&&csrf="+top.ICEcoder.csrf,tgtFiles.join(";").replace(/\+/g,"%2B"));
+ top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=delete&&csrf="+top.ICEcoder.csrf,encodeURIComponent(tgtFiles.join(";")));
top.ICEcoder.serverMessage(''+top.t['Deleting File']+'
'+tgtListDisplay);
};
},
@@ -2137,7 +2137,7 @@ var ICEcoder = {
if (top.ICEcoder.copiedFiles) {
for (var i=0; i'+top.t['Pasting File']+'
'+top.ICEcoder.copiedFiles[i].toString().replace(/\|/g,"/").replace(/,/g,"\n"));
} else {
top.ICEcoder.message(top.t['Sorry cannot paste...']);
@@ -2291,7 +2291,7 @@ var ICEcoder = {
xhr.open("POST","lib/file-control-xhr.php?action=checkExists&csrf="+top.ICEcoder.csrf,true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
timeStart = new Date().getTime();
- xhr.send('timeStart='+timeStart+'&file='+path.replace(/\+/g,"%2B"));
+ xhr.send('timeStart='+timeStart+'&file='+encodeURIComponent(path));
},
// Show menu on right clicking in file manager
@@ -2765,7 +2765,7 @@ var ICEcoder = {
// Replace text in a file
replaceInFile: function(fileRef,find,replace) {
- top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=replaceText&find="+find+"&replace="+replace+"&csrf="+top.ICEcoder.csrf,fileRef.replace(/\//g,"|").replace(/\+/g,"%2B"));
+ top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=replaceText&find="+find+"&replace="+replace+"&csrf="+top.ICEcoder.csrf,encodeURIComponent(fileRef.replace(/\//g,"|")));
top.ICEcoder.serverMessage(''+top.t['Replacing text in']+'
'+fileRef);
},
@@ -3294,7 +3294,7 @@ var ICEcoder = {
previousFiles = top.ICEcoder.openFiles.join(',').replace(/\//g,"|").replace(/(\|\[NEW\])|(,\|\[NEW\])/g,"").replace(/(^,)|(,$)/g,"");
if (previousFiles=="") {previousFiles="CLEAR"};
// Then send through to the settings page to update setting
- top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+previousFiles+"&csrf="+top.ICEcoder.csrf);
+ top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+encodeURIComponent(previousFiles)+"&csrf="+top.ICEcoder.csrf);
top.ICEcoder.updateLast10List(previousFiles);
},
@@ -3623,7 +3623,7 @@ var ICEcoder = {
chmod: function(file,perms) {
file = file.replace(top.iceRoot,"");
top.ICEcoder.showHide('hide',top.get('blackMask'));
- top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=perms&perms="+perms+"&csrf="+top.ICEcoder.csrf,file.replace(/\+/g,"%2B"));
+ top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=perms&perms="+perms+"&csrf="+top.ICEcoder.csrf,encodeURIComponent(file));
top.ICEcoder.serverMessage('chMod '+perms+' on
'+file.replace(/\|/g,"/"));
},
diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js
index d302c56..d679e6b 100644
--- a/lib/ice-coder.min.js
+++ b/lib/ice-coder.min.js
@@ -78,25 +78,25 @@ var get=function(a){return top.document.getElementById(a)},ICEcoder={filesW:250,
top.ICEcoder.tabBGcurrent:b.style.backgroundColor="select"==a?top.ICEcoder.tabBGselected:b.style.backgroundColor=c?top.ICEcoder.tabBGopen:top.ICEcoder.tabBGnormal;b.style.color="select"==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalFile}},boxSelect:function(a,b){var c=top.ICEcoder.filesFrame.contentWindow.document.getElementById("fmDragBox");"down"==b&&(top.ICEcoder.fmDragBoxStartX=top.ICEcoder.mouseX,top.ICEcoder.fmDragBoxStartY=top.ICEcoder.mouseY,top.ICEcoder.fmDragSelectFirst="",top.ICEcoder.fmDragSelectLast=
"");if(top.ICEcoder.mouseDown&&!top.ICEcoder.mouseDownInCM&&"drag"==b){top.ICEcoder.fmDraggedBox=!0;var d=0"+top.t["Creating Folder"]+
+ !1,"shiftSim")))}"up"==b&&(c.style.width=0,c.style.height=0)},newFile:function(){top.ICEcoder.newTab("alsoSave")},newFolder:function(){var a;var b=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/");if(a=top.ICEcoder.getInput("Enter new folder name at "+b,""))a=(b+"/"+a).replace(/\/\//,"/"),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=newFolder&csrf="+top.ICEcoder.csrf,encodeURIComponent(a.replace(/\//g,"|"))),top.ICEcoder.serverMessage(""+top.t["Creating Folder"]+
"
"+a)},returnFileAndLine:function(a){var b=1,c=/^([^ ]*)\s+(on\s+)?(line\s+)?(\d+)/.exec(a);null!==c?(b=c[4],a=c[1]):0"+top.t["Opening File"]+"
"+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab("new"),top.ICEcoder.fMIconVis("fMView",1))}},openFilesFromList:function(a){for(var b=0;b"+top.t["Opening File"]+"
"+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab("new"),top.ICEcoder.fMIconVis("fMView",1))}},openFilesFromList:function(a){for(var b=0;b"+top.t.Getting+"
"+a)},getChangesToSave:function(){var a=top.ICEcoder.getcMInstance();var b=top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1];a=difflib.stringAsLines(a.getValue());b=difflib.stringAsLines(b);b=(new difflib.SequenceMatcher(b,a)).get_opcodes();for(var c=0;c"+top.t.Saving+"
"+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){if(a)var c=a.replace(/\|/g,"/");else c=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/");b||(b=top.ICEcoder.getInput(top.t["Please enter the..."],c));if(b){var d=top.ICEcoder.openFiles.indexOf(c.replace(/\|/g,
+ a+"&csrf="+top.ICEcoder.csrf,encodeURIComponent(c),b);top.ICEcoder.serverMessage(""+top.t.Saving+"
"+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){if(a)var c=a.replace(/\|/g,"/");else c=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/");b||(b=top.ICEcoder.getInput(top.t["Please enter the..."],c));if(b){var d=top.ICEcoder.openFiles.indexOf(c.replace(/\|/g,
"/"));-1
',c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,
- ""),top.get("tab"+(d+1)).title=b);top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=rename&oldFileName="+a.replace(/\|/g,"/").replace(/\+/g,"%2B")+"&csrf="+top.ICEcoder.csrf,b.replace(/\+/g,"%2B"));top.ICEcoder.serverMessage(""+top.t["Renaming to"]+"
"+b);top.ICEcoder.setPreviousFiles()}},moveFile:function(a,b){if(b&&b!=a){var c=top.ICEcoder.openFiles.indexOf(a.replace(/\|/g,"/"));if(-1
';
- var d=top.ICEcoder.openFiles[c];top.get("tab"+(c+1)).innerHTML=closeTabLink+" "+d.slice(d.lastIndexOf("/")).replace(/\//,"");top.get("tab"+(c+1)).title=b}top.ICEcoder.ask("Are you sure you want to move file "+a+" to "+b+" ?")&&(top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=move&oldFileName="+a.replace(/\//g,"|").replace(/\+/g,"%2B")+"&csrf="+top.ICEcoder.csrf,b.replace(/\//g,"|").replace(/\+/g,"%2B")),top.ICEcoder.serverMessage(""+top.t["Moving to"]+"
"+b));top.ICEcoder.setPreviousFiles()}},
- deleteFiles:function(a){a=a?a:top.ICEcoder.selectedFiles;var b=a.toString().replace(/\|/g,"/").replace(/,/g,"\n");0"+top.t["Deleting File"]+"
"+b))},copyFiles:function(a,b,c){top.ICEcoder.copiedFiles=[];for(var d=0;d"+top.t["Pasting File"]+"
"+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message(top.t["Sorry cannot paste..."]);
+ ""),top.get("tab"+(d+1)).title=b);top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=rename&oldFileName="+encodeURIComponent(a.replace(/\|/g,"/"))+"&csrf="+top.ICEcoder.csrf,encodeURIComponent(b));top.ICEcoder.serverMessage(""+top.t["Renaming to"]+"
"+b);top.ICEcoder.setPreviousFiles()}},moveFile:function(a,b){if(b&&b!=a){var c=top.ICEcoder.openFiles.indexOf(a.replace(/\|/g,"/"));if(-1
';
+ var d=top.ICEcoder.openFiles[c];top.get("tab"+(c+1)).innerHTML=closeTabLink+" "+d.slice(d.lastIndexOf("/")).replace(/\//,"");top.get("tab"+(c+1)).title=b}top.ICEcoder.ask("Are you sure you want to move file "+a+" to "+b+" ?")&&(top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=move&oldFileName="+encodeURIComponent(a.replace(/\//g,"|"))+"&csrf="+top.ICEcoder.csrf,encodeURIComponent(b.replace(/\//g,"|"))),top.ICEcoder.serverMessage(""+top.t["Moving to"]+"
"+b));top.ICEcoder.setPreviousFiles()}},
+ deleteFiles:function(a){a=a?a:top.ICEcoder.selectedFiles;var b=a.toString().replace(/\|/g,"/").replace(/,/g,"\n");0"+top.t["Deleting File"]+"
"+b))},copyFiles:function(a,b,c){top.ICEcoder.copiedFiles=[];for(var d=0;d"+top.t["Pasting File"]+"
"+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message(top.t["Sorry cannot paste..."]);
else top.ICEcoder.message(top.t["Nothing to paste..."])},duplicateFiles:function(a){if(top.ICEcoder.copiedFiles)var b=top.ICEcoder.copiedFiles;top.ICEcoder.copyFiles(a,"dontShowPaste","dontHide");a=a[0].substr(0,a[0].lastIndexOf("|"));top.ICEcoder.pasteFiles(a);"undefined"!=typeof b&&(top.ICEcoder.copiedFiles=b)},uploadFilesSelect:function(a){top.get("uploadDir").value=a;top.get("fileInput").click()},uploadFilesSubmit:function(a){""!=top.get("fileInput").value&&(top.ICEcoder.showHide("show",top.get("loadingMask")),
top.get("uploadFilesForm").submit(),event.preventDefault())},showHideFileNav:function(a,b){var c=["optionsFile","optionsEdit","optionsSource","optionsHelp"];if("hide"==a)fileNavInt=setTimeout(function(){for(var a=0;ab&&(c-=c+a-b);top.get("fileMenu").style.top=c+"px"}return!1},showFileMenu:function(){top.get("fileMenu").style.display="inline-block";setTimeout(function(){top.get("fileMenu").style.opacity="1"},4)},hideFileMenu:function(){top.get("fileMenu").style.display="none";top.get("fileMenu").style.opacity="0"},updateFileManagerList:function(a,b,c,d,e,f,g){if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(top.iceRoot,
"").replace(/\/$/,"").replace(/\//g,"|")+"|"+c)){var l="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?top.ICEcoder.newFilePerms:top.ICEcoder.newDirPerms;b||(b="/");b=b.replace(top.iceRoot,"/");b=b.replace("//","/");var h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));var m=h.parentNode.parentNode.nextSibling;var n=document.createTextNode("\n");var p=777==d?"background: #800; color: #eee":"color: #888";p='';top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML=e;top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="inline-block";return!0}g.innerHTML="No results";
top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="none";return!1}""!=a&&c?(e=b=d="",document.findAndReplace.connector.value==top.t.and&&(d="&replace="+f),0<=document.findAndReplace.target.value.indexOf(top.t.file)&&(b="&target="+document.findAndReplace.target.value.replace(/ /g,"-")),document.findAndReplace.target.value==top.t["selected files"]&&(e="&selectedFiles="+top.ICEcoder.selectedFiles.join(":")),
a=a.replace(/'/g,"'"),a!=encodeURIComponent(a)?a="ICEcoder:"+encodeURIComponent(a):a,top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("mediaContainer").innerHTML=''):(g.innerHTML="No results",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display=
- "none")}},replaceInFile:function(a,b,c){top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=replaceText&find="+b+"&replace="+c+"&csrf="+top.ICEcoder.csrf,a.replace(/\//g,"|").replace(/\+/g,"%2B"));top.ICEcoder.serverMessage(""+top.t["Replacing text in"]+"
"+a)},getCaretPosition:function(){var a;var b=ICEcoder.getcMInstance();var c=ICEcoder.getcMdiffInstance();b=-1"+top.t["Replacing text in"]+"
"+a)},getCaretPosition:function(){var a;var b=ICEcoder.getcMInstance();var c=ICEcoder.getcMdiffInstance();b=-1'+top.t["Cancelled tasks"]+"");
- setTimeout(function(){top.ICEcoder.serverMessage()},2E3)},setPreviousFiles:function(){var 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);top.ICEcoder.updateLast10List(a)},updateLast10List:function(a){a=a.split(",");for(var b=0;b"+a[b].replace(/\|/g,"/")+"\n";var d=top.ICEcoder.content.contentWindow.document.getElementById("last10Files");if(-1==d.innerHTML.indexOf(c)){var e=d.innerHTML.split("\n");(10<=e.length||'[none]
'==e[0]||""==e[e.length-1])&&e.pop();d.innerHTML=c+e.join("\n")}}},autoOpenFiles:function(){if(0<
top.ICEcoder.previousFiles.length&&top.ICEcoder.ask(top.t["Open previous files"]+"\n\n"+top.ICEcoder.previousFiles.length+" files:\n"+top.ICEcoder.previousFiles.join("\n").replace(/\|/g,"/").replace(new RegExp(top.docRoot+top.iceRoot,"gi"),"")))for(var a=0;a');top.ICEcoder.showHide(a?"hide":"show",top.get("blackMask"))},helpScreen:function(){top.get("mediaContainer").innerHTML='';top.ICEcoder.showHide("show",top.get("blackMask"))},versionsScreen:function(a,b){top.get("mediaContainer").innerHTML='