Skip to content
This repository has been archived by the owner on Feb 10, 2021. It is now read-only.

Commit

Permalink
Fixes issue #3 by simply removing the $root variable altogether (noth…
Browse files Browse the repository at this point in the history
…ing sets it, so I assume it was abandoned code by someone with PHP notices turned off)
  • Loading branch information
daverogers committed Mar 21, 2013
1 parent eb8fe88 commit 3e7731d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions connectors/jqueryFileTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@

$_POST['dir'] = urldecode($_POST['dir']);

if( file_exists($root . $_POST['dir']) ) {
$files = scandir($root . $_POST['dir']);
if( file_exists($_POST['dir']) ) {
$files = scandir($_POST['dir']);
natcasesort($files);
if( count($files) > 2 ) { // The 2 accounts for . and ..
echo "<ul class=\"jqueryFileTree\" style=\"display: none;\">";
// All dirs
foreach( $files as $file ) {
if( file_exists($root . $_POST['dir'] . $file) && $file != '.' && $file != '..' && is_dir($root . $_POST['dir'] . $file) ) {
if( file_exists($_POST['dir'] . $file) && $file != '.' && $file != '..' && is_dir($_POST['dir'] . $file) ) {
echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "/\">" . htmlentities($file) . "</a></li>";
}
}
// All files
foreach( $files as $file ) {
if( file_exists($root . $_POST['dir'] . $file) && $file != '.' && $file != '..' && !is_dir($root . $_POST['dir'] . $file) ) {
if( file_exists($_POST['dir'] . $file) && $file != '.' && $file != '..' && !is_dir($_POST['dir'] . $file) ) {
$ext = preg_replace('/^.*\./', '', $file);
echo "<li class=\"file ext_$ext\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "\">" . htmlentities($file) . "</a></li>";
}
Expand Down

0 comments on commit 3e7731d

Please sign in to comment.