prevents debug users from exploring system's directory structure * ex: $root = $_SERVER['DOCUMENT_ROOT']; */ $root = '/'; if( !$root ) exit("ERROR: Root filesystem directory not set in jqueryFileTree.php"); $postDir = $root.(isset($_POST['dir']) ? $_POST['dir'] : '' ); if (substr($postDir, -1) != '/') { $postDir .= '/'; } $postDir = preg_replace("#[\/]+#", "/", $postDir); $filters = (array)(isset($_POST['filter']) ? $_POST['filter'] : ''); // set checkbox if multiSelect set to true $checkbox = ( isset($_POST['multiSelect']) && $_POST['multiSelect'] == 'true' ) ? "" : null; $returnDir = $postDir; echo "