diff --git a/common.php b/common.php index b011a80..dbf58a2 100644 --- a/common.php +++ b/common.php @@ -347,14 +347,14 @@ function main($path) if ($path1!='/'&&substr($path1,-1)=='/') $path1=substr($path1, 0, -1); $files = $drive->list_files($path1); } - if ($files['type']=='folder' && !$_SERVER['admin']) { - foreach ($files['list'] as $k => $v) { - if (isHideFile($k)) unset($files['list'][$k]); - } - } if ($_GET['json']) { // return a json + if ($files['type']=='folder' && !$_SERVER['admin']) { + foreach ($files['list'] as $k => $v) { + if (isHideFile($k)) unset($files['list'][$k]); + } + } return output(json_encode($files), 200, ['Content-Type' => 'application/json']); } // random file