diff options
author | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2014-11-04 20:55:52 +0300 |
---|---|---|
committer | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2014-11-04 20:55:52 +0300 |
commit | 897015ec1076d5e4c3d62057b9a4d18b68ef4fb6 (patch) | |
tree | c7610458427df28361010fedb0f7c266d96945a5 /lib | |
parent | d24863e97e3f31ecceea050dc4477a53dc1a7e58 (diff) |
Fix some other log notices when trying to access non-existing file with a viewer
Diffstat (limited to 'lib')
-rw-r--r-- | lib/downloadresponse.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/downloadresponse.php b/lib/downloadresponse.php index acd47df5..8c21d674 100644 --- a/lib/downloadresponse.php +++ b/lib/downloadresponse.php @@ -28,17 +28,17 @@ class DownloadResponse extends \OCP\AppFramework\Http\Response { $this->request = $request; $this->user = $user; $this->path = $path; + $this->view = new View('/' . $user); if (!$this->view->file_exists($path)){ - $this->setStatus(Http::STATUS_NOT_FOUND); + parent::setStatus(Http::STATUS_NOT_FOUND); } } public function render(){ - if ($this->status === Http::STATUS_NOT_FOUND){ + if (parent::getStatus() === Http::STATUS_NOT_FOUND){ return ''; } - $info = $this->view->getFileInfo($this->path); $this->ETag = $info['etag']; @@ -47,7 +47,7 @@ class DownloadResponse extends \OCP\AppFramework\Http\Response { $size = strlen($data['content']); - if (!is_null($this->request->server['HTTP_RANGE'])){ + if (isset($this->request->server['HTTP_RANGE']) && !is_null($this->request->server['HTTP_RANGE'])){ $isValidRange = preg_match('/^bytes=\d*-\d*(,\d*-\d*)*$/', $this->request->server['HTTP_RANGE']); if (!$isValidRange){ return $this->sendRangeNotSatisfiable($size); |