mirror of
https://github.com/Clortox/SimpleFileRepository.git
synced 2025-01-10 02:47:59 +00:00
Fix error with nested folders
This commit is contained in:
parent
d2c6d8af02
commit
377bc57762
12
listing.php
12
listing.php
@ -49,6 +49,7 @@
|
|||||||
$path = $_GET['path'];
|
$path = $_GET['path'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$elements = [];
|
||||||
if($handle = opendir($dir_dirs[$dir_index] . $path)){
|
if($handle = opendir($dir_dirs[$dir_index] . $path)){
|
||||||
while(false !== ($entry = readdir($handle))){
|
while(false !== ($entry = readdir($handle))){
|
||||||
//exclude . and ..
|
//exclude . and ..
|
||||||
@ -83,13 +84,22 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
|
if(count($elements) == 0){
|
||||||
|
echo <<< emptylisting
|
||||||
|
<tr>
|
||||||
|
<td>Oops! This folder is empty...</td>
|
||||||
|
<td></td>
|
||||||
|
<td>0</td>
|
||||||
|
</tr>
|
||||||
|
emptylisting;
|
||||||
|
}
|
||||||
foreach($elements as $i=>$currentfile){
|
foreach($elements as $i=>$currentfile){
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo "<td>" . $currentfile . "</td>";
|
echo "<td>" . $currentfile . "</td>";
|
||||||
$fulldir = $dir_dirs[$dir_index] . $path . "/" . $currentfile;
|
$fulldir = $dir_dirs[$dir_index] . $path . "/" . $currentfile;
|
||||||
if(is_dir($fulldir)){
|
if(is_dir($fulldir)){
|
||||||
echo "<td><a href=\"listing.php?folder="
|
echo "<td><a href=\"listing.php?folder="
|
||||||
. $dir . "&path=%2F" . $currentfile
|
. $dir . "&path=" . $path . "/" . $currentfile
|
||||||
. "\">View Directory</a></td>";
|
. "\">View Directory</a></td>";
|
||||||
echo "<td>" . foldersize($fulldir) . "</td>";
|
echo "<td>" . foldersize($fulldir) . "</td>";
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user