mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 18:49:17 -07:00
Added file existence check.
I added a check to see if the file exists.
This commit is contained in:
parent
8503efa6fe
commit
d5441fdf85
1 changed files with 5 additions and 9 deletions
|
@ -8,20 +8,16 @@ if ((!isset($_SESSION['FILEMANAGER_KEY'])) || (empty($_SESSION['FILEMANAGER_KEY'
|
|||
|
||||
$user = $_SESSION['user'];
|
||||
if (($_SESSION['user'] == 'admin') && (!empty($_SESSION['look']))) {
|
||||
$user=$_SESSION['look'];
|
||||
$user = $_SESSION['look'];
|
||||
}
|
||||
|
||||
if (!empty($_REQUEST['path'])) {
|
||||
$path = $_REQUEST['path'];
|
||||
$path = $_REQUEST['path'];
|
||||
if (!empty($path) && file_exists($path)) {
|
||||
header("Content-type: application/octet-stream");
|
||||
header("Content-Transfer-Encoding: binary");
|
||||
header("Content-disposition: attachment;filename=".basename($path));
|
||||
passthru (VESTA_CMD . "v-open-fs-file " . $user . " " . escapeshellarg($path));
|
||||
passthru(VESTA_CMD . "v-open-fs-file " . $user . " " . escapeshellarg($path));
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
die('File not found');
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue