fix download link for single files in publicly shared directory
This commit is contained in:
parent
ee6d96b7a8
commit
99f4d949c1
1 changed files with 7 additions and 3 deletions
|
@ -83,8 +83,12 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
|
|||
// Download the file
|
||||
if (isset($_GET['download'])) {
|
||||
if (isset($_GET['dir'])) {
|
||||
if (isset($_GET['path']) && $_GET['path'] != '' ) { // download a file from a shared directory
|
||||
OC_Files::get('', $path, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
|
||||
} else { // download the whole shared directory
|
||||
OC_Files::get($path, '', $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
|
||||
} else {
|
||||
}
|
||||
} else { // download a single shared file
|
||||
OC_Files::get("", $path, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
|
||||
}
|
||||
|
||||
|
@ -108,7 +112,7 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
|
|||
$i['basename'] = $fileinfo['filename'];
|
||||
$i['extension'] = isset($fileinfo['extension']) ? ('.'.$fileinfo['extension']) : '';
|
||||
}
|
||||
$i['directory'] = substr($i['directory'], $rootLength);
|
||||
$i['directory'] = '/'.substr('/'.$uidOwner.'/files'.$i['directory'], $rootLength);
|
||||
if ($i['directory'] == '/') {
|
||||
$i['directory'] = '';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue