From 0f10702cf98f28251e272f808b40a3600a9f43c0 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sun, 25 Aug 2019 13:21:05 +0100 Subject: [PATCH] Settings file in data dir when going to root --- lib/go-localhost-root.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/go-localhost-root.php b/lib/go-localhost-root.php index 868aace..a389a1b 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 = getData($settingsFile); + $settingsContents = getData("../data/".$settingsFile); // Replace our root var $repPosStart = strpos($settingsContents,'"root"'); $repPosEnd = strpos($settingsContents,'"checkUpdates"'); @@ -18,9 +18,9 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn']) { substr($settingsContents,($repPosEnd),strlen($settingsContents)); // Now update the config file - if (is_writeable($settingsFile)) { - $fh = fopen($settingsFile, 'w'); - fwrite($fh, $settingsContents); + if (is_writeable("../data/".$settingsFile)) { + $fh = fopen("../data/".$settingsFile, 'w'); + fwrite($fh, "../data/".$settingsContents); fclose($fh); // Clear any FTP session we may have @@ -29,7 +29,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn']) { // Now we've reset the root path to localhost root, refresh the file manager to show it echo ""; } else { - echo ""; + echo ""; } ?>