Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Check if the file exists before trying to download it
  • Loading branch information
jvillafanez committed Aug 8, 2017
commit 0788ebf1cb8bb87e76a6e6056ac3b525dc31140c
5 changes: 3 additions & 2 deletions apps/dav/lib/Connector/Sabre/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,12 @@ private function emitPostHooks($exists, $path = null) {
public function get() {
//throw exception if encryption is disabled but files are still encrypted
try {
if (!$this->info->isReadable()) {
$viewPath = ltrim($this->path, '/');
if (!$this->info->isReadable() || !$this->fileView->file_exists($viewPath)) {
// do a if the file did not exist
throw new NotFound();
}
$res = $this->fileView->fopen(ltrim($this->path, '/'), 'rb');
$res = $this->fileView->fopen($viewPath, 'rb');
if ($res === false) {
throw new ServiceUnavailable("Could not open file");
}
Expand Down