From 948978b5e19877af58476b266d2cd63bb80f85ba Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Fri, 20 Jul 2012 17:25:51 +0100 Subject: [PATCH] docRoot is now the tree root, simplified saveFile --- lib/file-control.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/file-control.php b/lib/file-control.php index f410b50..f3ae44d 100644 --- a/lib/file-control.php +++ b/lib/file-control.php @@ -4,7 +4,7 @@ // Establish the full file path reference $file=strClean($_GET['file']); if (isset($_GET['saveType'])) {$saveType = strClean($_GET['saveType']);}; -$docRoot = str_replace("\\","/",$_SERVER['DOCUMENT_ROOT']); +$docRoot = str_replace("\\","/",$ICEcoder['root']); // Not done the first time we are on the save loop (ie, before the form posting reload) if ($_GET['action']=="load"||$_GET['action']=="newFolder"||$_GET['action']=="rename"||$_GET['action']=="delete"||$_GET['action']=="perms"||isset($_POST['contents'])) { @@ -154,7 +154,7 @@ if ($_GET['action']=="save") { if (isset($_POST['newFileName'])&&$_POST['newFileName']!="") { $file = strClean($_POST['newFileName']); } - $saveFile = str_replace("\\","/",$_SERVER['DOCUMENT_ROOT']).$file; + $saveFile = $docRoot.$file; $saveFile = str_replace("//","/",$saveFile); if ((file_exists($saveFile) && is_writable($saveFile)) || $_POST['newFileName']!="") { if (filemtime($saveFile)==$_GET['fileMDT']||!(isset($_GET['fileMDT']))) {