From 3d8644ae4cbc2ee59341dae816b5f8ff8a9cd16a Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Thu, 25 Aug 2016 14:44:18 +0100 Subject: [PATCH] Using getData function now --- lib/backup-versions-preview-loader.php | 2 +- lib/file-control.php | 2 +- lib/ftp-manager.php | 2 +- lib/get-branch.php | 2 +- lib/github-manager.php | 2 +- lib/go-localhost-root.php | 2 +- lib/multiple-results.php | 4 ++-- lib/settings-save-current-files.php | 2 +- lib/settings-update.php | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/backup-versions-preview-loader.php b/lib/backup-versions-preview-loader.php index 80d36c5..0f44e03 100644 --- a/lib/backup-versions-preview-loader.php +++ b/lib/backup-versions-preview-loader.php @@ -6,7 +6,7 @@ include("settings.php"); $file = str_replace("|","/",xssClean($_GET['file'],'html')); // Get contents -$loadedFile = toUTF8noBOM(file_get_contents("../backups/".$file,false,$context),true); +$loadedFile = toUTF8noBOM(getData("../backups/".$file),true); $encoding=ini_get("default_charset"); if($encoding=="") $encoding="UTF-8"; diff --git a/lib/file-control.php b/lib/file-control.php index b728c09..90a6891 100644 --- a/lib/file-control.php +++ b/lib/file-control.php @@ -105,7 +105,7 @@ if ($_GET['action']=="load") { ftpEnd(); // Get local file } else { - $loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true); + $loadedFile = toUTF8noBOM(getData($file),true); } $encoding=ini_get("default_charset"); if($encoding=="") diff --git a/lib/ftp-manager.php b/lib/ftp-manager.php index c519196..3fa5b5d 100644 --- a/lib/ftp-manager.php +++ b/lib/ftp-manager.php @@ -8,7 +8,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset // Get our old FTP sites & user settings $oldFTPSites = $ICEcoder["ftpSites"]; - $settingsContents = file_get_contents($settingsFile,false,$context); + $settingsContents = getData($settingsFile); // ======== // CHOOSING diff --git a/lib/get-branch.php b/lib/get-branch.php index a8334b3..2fe2b5a 100644 --- a/lib/get-branch.php +++ b/lib/get-branch.php @@ -230,7 +230,7 @@ if (!isset($ftpSite) && $_SESSION['githubDiff']) { // If we're not looking at a .git dir, it's not a .gitignore excluded path and not a dir if (strpos($fileFolderName,".git/") == false && !in_array($docRoot.$iceRoot.$fileFolderName, $excluded) && !is_dir($docRoot.$iceRoot.$fileFolderName)) { // Get contents of file - $contents = file_get_contents($docRoot.$iceRoot.$fileFolderName); + $contents = getData($docRoot.$iceRoot.$fileFolderName); $finfo = "text"; // Determine if we should remove \r line endings based on mime type (text files yes, others no) diff --git a/lib/github-manager.php b/lib/github-manager.php index 18eb694..40c7f36 100644 --- a/lib/github-manager.php +++ b/lib/github-manager.php @@ -9,7 +9,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset // Get our old paths & user settings $oldLocal = $ICEcoder["githubLocalPaths"]; $oldRemote = $ICEcoder["githubRemotePaths"]; - $settingsContents = file_get_contents($settingsFile,false,$context); + $settingsContents = getData($settingsFile); // ======== // CHOOSING diff --git a/lib/go-localhost-root.php b/lib/go-localhost-root.php index 82d98aa..7117b89 100644 --- a/lib/go-localhost-root.php +++ b/lib/go-localhost-root.php @@ -6,7 +6,7 @@ $t = $text['settings-update']; // Update our 'root' value to be blank // which resets the file manager to localhost root again if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn']) { - $settingsContents = file_get_contents($settingsFile,false,$context); + $settingsContents = getData($settingsFile); // Replace our root var $repPosStart = strpos($settingsContents,'"root"'); $repPosEnd = strpos($settingsContents,'"checkUpdates"'); diff --git a/lib/multiple-results.php b/lib/multiple-results.php index ad637ed..8c3ecd1 100644 --- a/lib/multiple-results.php +++ b/lib/multiple-results.php @@ -125,7 +125,7 @@ if (startTab!=top.ICEcoder.selectedTab) { $fullPath = $path.$slash.$f; if(is_dir($fullPath)) { $ret .= phpGrep($q, $fullPath, $base); - } else if(stristr(toUTF8noBOM(file_get_contents($fullPath,false,$context),false), $q)) { + } else if(stristr(toUTF8noBOM(getData($fullPath),false), $q)) { $bFile = false; $foundInSelFile = false; // Exclude banned files @@ -147,7 +147,7 @@ if (startTab!=top.ICEcoder.selectedTab) { } if (!$bFile && (count($selectedFiles)==0 || count($selectedFiles)>0 && $foundInSelFile)) { $ret .= ""; - $ret .= str_replace($base,"",$fullPath)."
".$t['Found']." ".substr_count(strtolower(toUTF8noBOM(file_get_contents($fullPath,false,$context),false)),$q)." ".$t['times']."
"; + $ret .= str_replace($base,"",$fullPath)."
".$t['Found']." ".substr_count(strtolower(toUTF8noBOM(getData($fullPath),false)),$q)." ".$t['times']."
"; if (isset($_GET['replace'])) { $ret .= "
".$t['replace']."
"; }; diff --git a/lib/settings-save-current-files.php b/lib/settings-save-current-files.php index ed98ef6..44b1b06 100644 --- a/lib/settings-save-current-files.php +++ b/lib/settings-save-current-files.php @@ -5,7 +5,7 @@ $t = $text['settings-save-current-files']; // Save the currently opened files for next time if ($_SESSION['loggedIn'] && isset($_GET["saveFiles"]) && $_GET['saveFiles']) { - $settingsContents = file_get_contents($settingsFile,false,$context); + $settingsContents = getData($settingsFile); // Replace our previousFiles var with the the current $repPosStart = strpos($settingsContents,'previousFiles" => "')+20; diff --git a/lib/settings-update.php b/lib/settings-update.php index ef8f1f7..f1ae414 100644 --- a/lib/settings-update.php +++ b/lib/settings-update.php @@ -5,7 +5,7 @@ $t = $text['settings-update']; // Update this config file? if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_POST["theme"]) && $_POST["theme"]) { - $settingsContents = file_get_contents($settingsFile,false,$context); + $settingsContents = getData($settingsFile); // Replace our settings vars $repPosStart = strpos($settingsContents,'"root"'); $repPosEnd = strpos($settingsContents,'"plugins"'); @@ -84,7 +84,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset $refreshFM = $_POST['changedFileSettings']=="true" ? "true" : "false"; // Change multiUser and enableRegistration in config___settings.php - $generalSettingsContents = file_get_contents($configSettings,false,$context); + $generalSettingsContents = getData($configSettings); $isMultiUser = isset($_POST['multiUser']) && $_POST['multiUser'] ? "true" : "false"; $generalSettingsContents = str_replace('"multiUser" => true,','"multiUser" => '.$isMultiUser.',',$generalSettingsContents); $generalSettingsContents = str_replace('"multiUser" => false,','"multiUser" => '.$isMultiUser.',',$generalSettingsContents);