From 8c83378b8b1f8c85a104fe473935d49cedacf71b Mon Sep 17 00:00:00 2001 From: Wim Tibackx Date: Mon, 7 May 2012 21:20:58 +0200 Subject: [PATCH 1/3] Fixing issue #49: Notices in settings.php (unknown POST/GET-keys). About fix for issue #49 (example: lib/settings.php line 46): If isset(post theme) gives false, post theme would've given that too. If it gives true, validation is still the same as before. --- lib/settings.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/settings.php b/lib/settings.php index 6d5fd9a..935c65c 100644 --- a/lib/settings.php +++ b/lib/settings.php @@ -25,7 +25,7 @@ $openLastFiles = true; $codeAssist = true; $visibleTabs = false; $lockedNav = true; -$accountPassword = ""; +$accountPassword = "c640d2e8f2ef763f35be2d825bd9480b39b7392d2e412c0a3"; $restrictedFiles = array("wp-",".php",".asp",".aspx"); $bannedFiles = array("_coder","wp-",".exe",".sql"); $allowedIPs = array("*"); @@ -35,7 +35,7 @@ $plugins = array( array("Backup","images/backup-open-files.png","margin-top: 3px","plugins/backupOpenFiles/index.php","fileControl:Zipping Open Files","10") ); $theme = "default"; -$lastOpenedFiles = ""; +$lastOpenedFiles = "|index.php"; // --------------- // End of settings @@ -43,7 +43,7 @@ $lastOpenedFiles = ""; // Update this settings file? -if ($_POST["theme"] && $_SESSION['userLevel'] == 10) { +if (isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10) { $settingsFile = 'settings.php'; $settingsContents = file_get_contents($settingsFile); // Replace our lastOpenedFiles var with the the current @@ -97,7 +97,7 @@ if ($_POST["theme"] && $_SESSION['userLevel'] == 10) { } // Save the currently opened files for next time -if ($_GET['saveFiles']) { +if (isset($_GET["saveFiles"]) && $_GET['saveFiles']) { if ($_SESSION['userLevel'] == 10) { $settingsFile = 'settings.php'; $settingsContents = file_get_contents($settingsFile); @@ -144,9 +144,9 @@ if ($shortURLStarts[count($shortURLStarts)-1]!="") {$trimArray=1;} else {$trimAr $shortURLStarts = $shortURLStarts[count($shortURLStarts)-$trimArray]; // If we're updating or calling from the index.php page, do/redo plugins & last opened files -if (($_POST["theme"] && $_SESSION['userLevel'] == 10) || strpos($_SERVER['PHP_SELF'],"index.php")>0) { +if ((isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10) || strpos($_SERVER['PHP_SELF'],"index.php")>0) { // If we're updating, we need to recreate the plugins array - if ($_POST["theme"] && $_SESSION['userLevel'] == 10) { + if (isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10) { $plugins = array(); $pluginsArray = explode("====================",str_replace("\"","",str_replace("\r","",str_replace("\n","",$_POST['plugins'])))); for ($i=0;$itop.document.getElementById('pluginsContainer').innerHTML = '".$pluginsDisplay."';"; } @@ -175,7 +175,7 @@ if (($_POST["theme"] && $_SESSION['userLevel'] == 10) || strpos($_SERVER['PHP_SE }; // If we're updating our settings, clear existing setIntervals & the array refs, then start new ones - if ($_POST["theme"] && $_SESSION['userLevel'] == 10) { + if (isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10) { ?>