Merge pull request #3063 from patrickrb/sstv-directory-fixes

SSTV directory fixes
pull/3067/head
Peter Goodhall 2024-04-08 11:05:10 +01:00 zatwierdzone przez GitHub
commit 96fdf31588
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
2 zmienionych plików z 25 dodań i 13 usunięć

Wyświetl plik

@ -2,22 +2,26 @@
if (!function_exists('folderSize')) {
function folderSize($dir){
$count_size = 0;
$count = 0;
$dir_array = scandir($dir);
foreach($dir_array as $key=>$filename){
if($filename!=".." && $filename!="."){
if(is_dir($dir."/".$filename)){
$new_foldersize = folderSize($dir."/".$filename);
$count_size = $count_size+ $new_foldersize;
}else if(is_file($dir."/".$filename)){
$count_size = $count_size + filesize($dir."/".$filename);
$count++;
if (is_dir($dir)) {
$count_size = 0;
$count = 0;
$dir_array = scandir($dir);
foreach($dir_array as $key=>$filename){
if($filename!=".." && $filename!="."){
if(is_dir($dir."/".$filename)){
$new_foldersize = folderSize($dir."/".$filename);
$count_size = $count_size+ $new_foldersize;
}else if(is_file($dir."/".$filename)){
$count_size = $count_size + filesize($dir."/".$filename);
$count++;
}
}
}
return $count_size;
} else {
return 0;
}
return $count_size;
}
}
}
if (!function_exists('sizeFormat')) {

Wyświetl plik

@ -0,0 +1,8 @@
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>