diff --git a/files.php b/files.php index a8c8c86..f690676 100644 --- a/files.php +++ b/files.php @@ -14,7 +14,7 @@ include("lib/settings.php"); $ICEcoder["restrictedFiles"] = $_SESSION['restrictedFiles']; $ICEcoder["bannedFiles"] = $_SESSION['bannedFiles']; -strrpos($_SERVER['DOCUMENT_ROOT'],":") ? $serverType = "Windows" : $serverType = "Linux"; +$serverType = strrpos($_SERVER['DOCUMENT_ROOT'],":") ? "Windows" : "Linux"; // Function to sort given values alphabetically function alphasort($a, $b) { @@ -35,7 +35,7 @@ class SortingIterator implements IteratorAggregate { } // Get a full list of dirs & files and begin sorting using above class & function -$path = $_SERVER['DOCUMENT_ROOT']; +$path = $ICEcoder["root"]; $objectList = new SortingIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST), 'alphasort'); // With that done, create arrays for out final ordered list and a temp container of files @@ -81,11 +81,20 @@ if ($serverType=="Linux") { $chmodInfo = substr(sprintf('%o', fileperms($path)), -3); $fileAtts = ''.$chmodInfo.''; } -echo "