resultsDisplay += ''+spansArray[i].innerHTML+'
';
- resultsDisplay += ''+spansArray[i].innerHTML+', '+targetURL.replace(/\|/g,"/").replace(/_perms/g,"").replace(//g,"")+'
';
+ resultsDisplay += ''+spansArray[i].innerHTML+', '+targetURL.replace(/\|/g,"/").replace(/_perms/g,"").replace(//g,"")+'
';
@@ -200,7 +200,7 @@ var replaceAll = function() {
}
var replaceInFileSingle = function(fileRef) {
- top.ICEcoder.replaceInFile(fileRef,findText,'');
+ top.ICEcoder.replaceInFile(fileRef,findText,'');
}
var replaceInFilesAll = function() {
@@ -212,7 +212,7 @@ var replaceInFilesAll = function() {
var renameSingle = function(arrayRef) {
fileRef = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"");
- newName = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"").replace(find,"");
+ newName = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"").replace(find,"");
top.ICEcoder.renameFile(fileRef,newName);
}
diff --git a/lib/plugins-manager.php b/lib/plugins-manager.php
index 11db108..e26fa88 100644
--- a/lib/plugins-manager.php
+++ b/lib/plugins-manager.php
@@ -25,7 +25,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
// Store the plugin zip to the tmp dir
$target = '../plugins/';
- $zipURL = $pluginsData[strClean($_GET['plugin'])]['zipURL'];
+ $zipURL = $pluginsData[$_GET['plugin']]['zipURL'];
$zipFile = "../tmp/".basename($zipURL);
$fileData = getData($zipURL,'curl');
file_put_contents($zipFile, $fileData);
@@ -95,7 +95,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
// Finally, delete the plugin itself
$target = '../plugins/';
- $dirName = basename($pluginsData[strClean($_GET['plugin'])]['zipURL'],".zip");
+ $dirName = basename($pluginsData[$_GET['plugin']]['zipURL'],".zip");
deletePlugin($target.$dirName."/");
}
diff --git a/lib/properties.php b/lib/properties.php
index 615a475..06bce73 100644
--- a/lib/properties.php
+++ b/lib/properties.php
@@ -4,7 +4,7 @@ include("settings.php");
$t = $text['properties'];
// Establish the real absolute path to the file/folder
-$fileName=realpath($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['fileName'])));
+$fileName=realpath($docRoot.$iceRoot.str_replace("|","/",$_GET['fileName']));
// If it doesn't exist, or doesn't start with the $docRoot, stop here
if (!file_exists($fileName) || strpos(str_replace("\\","/",$fileName),$docRoot) !== 0) {
die("");
@@ -47,7 +47,7 @@ echo number_format($outputSize, 2, '.', '').$outputUnit." (".number_format($byte
:
:
-:
+:
/
:
diff --git a/lib/settings-common.php b/lib/settings-common.php
index b3782ba..838a848 100644
--- a/lib/settings-common.php
+++ b/lib/settings-common.php
@@ -168,11 +168,6 @@ function verifyHash($pw, $orig) {
return $origSalt.sha1($origSalt.$pw);
}
-// returns converted entities which have HTML entity equivalents
-function strClean($var) {
- return preg_replace("/javascript\:/i","javascript:",htmlentities($var, ENT_QUOTES, "UTF-8"));
-}
-
// returns a number, whole or decimal or null
function numClean($var) {
return is_numeric($var) ? floatval($var) : false;
diff --git a/lib/settings-save-current-files.php b/lib/settings-save-current-files.php
index 47f955c..1bc88b7 100644
--- a/lib/settings-save-current-files.php
+++ b/lib/settings-save-current-files.php
@@ -12,7 +12,7 @@ if ($_SESSION['loggedIn'] && isset($_GET["saveFiles"]) && $_GET['saveFiles']) {
$repPosEnd = strpos($settingsContents,'",',$repPosStart)-$repPosStart;
if (!$demoMode) {
if ($_GET['saveFiles']!="CLEAR") {
- $saveFiles=strClean($_GET['saveFiles']);
+ $saveFiles=$_GET['saveFiles'];
$saveFilesArray = explode(",",$saveFiles);
$saveFiles="";
for ($i=0;$i= 0 ? intval($_POST['bugFileCheckTimer']) : 0;
- $ICEcoder["bugFileMaxLines"] = intval($_POST['bugFileMaxLines']);
- $ICEcoder["githubAuthToken"] = strClean($_POST['githubAuthToken']);
+ $ICEcoder = array_merge(
+ $ICEcoder,
+ [
+ "root" => xssClean($_POST['root'],"html"),
+ "checkUpdates" => isset($_POST['checkUpdates']) && $_POST['checkUpdates'] ? "true" : "false",
+ "openLastFiles" => isset($_POST['openLastFiles']) && $_POST['openLastFiles'] ? "true" : "false",
+ "updateDiffOnSave" => isset($_POST['updateDiffOnSave']) && $_POST['updateDiffOnSave'] ? "true" : "false",
+ "languageUser" => $_POST['languageUser'],
+ "backupsKept" => isset($_POST['backupsKept']) && $_POST['backupsKept'] ? "true" : "false",
+ "backupsDays" => intval($_POST['backupsDays']),
+ "deleteToTmp" => isset($_POST['deleteToTmp']) && $_POST['deleteToTmp'] ? "true" : "false",
+ "findFilesExclude" => 'array("'.str_replace(',','","',str_replace(" ","",$_POST['findFilesExclude'])).'")',
+ "codeAssist" => isset($_POST['codeAssist']) && $_POST['codeAssist'] ? "true" : "false",
+ "visibleTabs" => isset($_POST['visibleTabs']) && $_POST['visibleTabs'] ? "true" : "false",
+ "lockedNav" => isset($_POST['lockedNav']) && $_POST['lockedNav'] ? "true" : "false",
+ "tagWrapperCommand" => $_POST['tagWrapperCommand'],
+ "autoComplete" => $_POST['autoComplete'],
+ "bannedFiles" => 'array("'.str_replace(',','","',str_replace(" ","",$_POST['bannedFiles'])).'")',
+ "bannedPaths" => 'array("'.str_replace(',','","',str_replace(" ","",$_POST['bannedPaths'])).'")',
+ "allowedIPs" => 'array("'.str_replace(',','","',str_replace(" ","",$_POST['allowedIPs'])).'")',
+ "autoLogoutMins" => intval($_POST['autoLogoutMins']),
+ "theme" => $_POST['theme'],
+ "fontSize" => $_POST['fontSize'],
+ "lineWrapping" => $_POST['lineWrapping'],
+ "lineNumbers" => $_POST['lineNumbers'],
+ "showTrailingSpace" => $_POST['showTrailingSpace'],
+ "matchBrackets" => $_POST['matchBrackets'],
+ "autoCloseTags" => $_POST['autoCloseTags'],
+ "autoCloseBrackets" => $_POST['autoCloseBrackets'],
+ "indentWithTabs" => $_POST['indentWithTabs'],
+ "indentAuto" => $_POST['indentAuto'],
+ "indentSize" => intval($_POST['indentSize']),
+ "pluginPanelAligned" => $_POST['pluginPanelAligned'],
+ "bugFilePaths" => 'array("'.str_replace(',','","',str_replace(" ","",$_POST['bugFilePaths'])).'")',
+ "bugFileCheckTimer" => intval($_POST['bugFileCheckTimer']) >= 0 ? intval($_POST['bugFileCheckTimer']) : 0,
+ "bugFileMaxLines" => intval($_POST['bugFileMaxLines']),
+ "githubAuthToken" => $_POST['githubAuthToken']
+ ]
+ );
+
+ if ($_POST['password']!="") {$ICEcoder["password"] = generateHash($_POST['password']);};
$settingsArray = array("root","checkUpdates","openLastFiles","updateDiffOnSave","languageUser","backupsKept","backupsDays","deleteToTmp","findFilesExclude","codeAssist","visibleTabs","lockedNav","tagWrapperCommand","autoComplete","password","bannedFiles","bannedPaths","allowedIPs","autoLogoutMins","theme","fontSize","lineWrapping","lineNumbers","showTrailingSpace","matchBrackets","autoCloseTags","autoCloseBrackets","indentWithTabs","indentAuto","indentSize","pluginPanelAligned","bugFilePaths","bugFileCheckTimer","bugFileMaxLines","githubAuthToken");
$settingsNew = "";
@@ -56,7 +62,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
$settingsNew .= '"'.$settingsArray[$i].'" => ';
// Wrap certain values in double quotes
$settingWrap = $settingsArray[$i]=="root"||$settingsArray[$i]=="password"||$settingsArray[$i]=="languageUser"||$settingsArray[$i]=="theme"||$settingsArray[$i]=="fontSize"||$settingsArray[$i]=="tagWrapperCommand"||$settingsArray[$i]=="autoComplete"||$settingsArray[$i]=="pluginPanelAligned"||$settingsArray[$i]=="githubAuthToken" ? '"' : '';
-
+
if ($settingsArray[$i]=="password") {
$settingsNew .= str_replace("\$", "\\$", $settingWrap.$ICEcoder[$settingsArray[$i]].$settingWrap.','.PHP_EOL);
} else {
@@ -79,7 +85,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
// OK, now the config file has been updated, update our current session with new arrays
$settingsArray = array("findFilesExclude","bannedFiles","allowedIPs");
for ($i=0;$itop.ICEcoder.settingsScreen('hide');top.ICEcoder.useNewSettings('".$themeURL."',".$ICEcoder["codeAssist"].",".$ICEcoder["lockedNav"].",'".$ICEcoder["tagWrapperCommand"]."','".$ICEcoder["autoComplete"]."',".$ICEcoder["visibleTabs"].",'".$ICEcoder["fontSize"]."',".$ICEcoder["lineWrapping"].",".$ICEcoder["lineNumbers"].",".$ICEcoder["showTrailingSpace"].",".$ICEcoder["matchBrackets"].",".$ICEcoder["autoCloseTags"].",".$ICEcoder["autoCloseBrackets"].",".$ICEcoder["indentWithTabs"].",".$ICEcoder["indentAuto"].",".$ICEcoder["indentSize"].",'".$ICEcoder["pluginPanelAligned"]."',".$jsBugFilePaths.",".$ICEcoder["bugFileCheckTimer"].",".$ICEcoder["bugFileMaxLines"].",'".$githubAuthTokenSet."',".$ICEcoder["updateDiffOnSave"].",".$ICEcoder["autoLogoutMins"].",".$refreshFM.");top.iceRoot = '".$ICEcoder["root"]."';";
}
diff --git a/lib/settings.php b/lib/settings.php
index 8801afc..d2f5c13 100644
--- a/lib/settings.php
+++ b/lib/settings.php
@@ -26,8 +26,8 @@ include_once(dirname(__FILE__)."/settings-common.php");
// Establish user settings file
$username = "";
-if (isset($_POST['username']) && $_POST['username'] != "") {$username = strClean($_POST['username']."-");};
-if (isset($_SESSION['username']) && $_SESSION['username'] != "") {$username = strClean($_SESSION['username']."-");};
+if (isset($_POST['username']) && $_POST['username'] != "") {$username = $_POST['username']."-";};
+if (isset($_SESSION['username']) && $_SESSION['username'] != "") {$username = $_SESSION['username']."-";};
$settingsFile = 'config-'.$username.str_replace(".","_",str_replace("www.","",$_SERVER['SERVER_NAME'])).'.php';
// Login is default
@@ -115,7 +115,7 @@ if (!isset($_SESSION['username'])) {$_SESSION['username'] = false;};
// Attempt a login with password
if(isset($_POST['submit']) && $setPWorLogin=="login") {
// On success, set username if multiUser, loggedIn to true and redirect
- if (verifyHash(strClean($_POST['password']),$ICEcoder["password"])==$ICEcoder["password"]) {
+ if (verifyHash($_POST['password'],$ICEcoder["password"])==$ICEcoder["password"]) {
session_regenerate_id();
if ($ICEcoder["multiUser"]) {
$_SESSION['username'] = $_POST['username'];
@@ -195,7 +195,7 @@ if ((!$_SESSION['loggedIn'] || $ICEcoder["password"] == "") && !strpos($_SERVER[
} elseif (!$_SESSION['loggedIn']) {
// If the password hasn't been set and we're setting it
if ($ICEcoder["password"] == "" && isset($_POST['submit']) && (strpos($_POST['submit'],"set password")>-1)) {
- $password = str_replace("\$", "\\$", generateHash(strClean($_POST['password'])));
+ $password = str_replace("\$", "\\$", generateHash($_POST['password']));
$settingsContents = getData("../data/".$settingsFile);
// Replace our empty password with the one submitted by user
$settingsContents = str_replace('"password" => "",','"password" => "'.$password.'",',$settingsContents);