Skip to content

Commit

Permalink
Merge pull request nextcloud#10828 from nextcloud/bugfix/fac-108/mime…
Browse files Browse the repository at this point in the history
…type-detection-broken-for-junked-uploads

Fix mimetype detection for junked uploads
  • Loading branch information
MorrisJobke authored Aug 24, 2018
2 parents e8817ed + c574212 commit d8e876c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions apps/workflowengine/lib/Check/FileMimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,13 @@ protected function getActualValue() {
return $this->mimeType[$this->storage->getId()][$this->path];
}

if ($this->request->getMethod() === 'PUT') {
$path = $this->request->getPathInfo();
$this->mimeType[$this->storage->getId()][$this->path] = $this->mimeTypeDetector->detectPath($path);
if ($this->request->getMethod() === 'PUT' || $this->request->getMethod() === 'MOVE') {
if ($this->request->getMethod() === 'MOVE') {
$this->mimeType[$this->storage->getId()][$this->path] = $this->mimeTypeDetector->detectPath($this->path);
} else {
$path = $this->request->getPathInfo();
$this->mimeType[$this->storage->getId()][$this->path] = $this->mimeTypeDetector->detectPath($path);
}
return $this->mimeType[$this->storage->getId()][$this->path];
}
} else if ($this->isPublicWebDAVRequest()) {
Expand Down Expand Up @@ -171,7 +175,9 @@ protected function isWebDAVRequest() {
$this->request->getPathInfo() === '/webdav' ||
strpos($this->request->getPathInfo(), '/webdav/') === 0 ||
$this->request->getPathInfo() === '/dav/files' ||
strpos($this->request->getPathInfo(), '/dav/files/') === 0
strpos($this->request->getPathInfo(), '/dav/files/') === 0 ||
$this->request->getPathInfo() === '/dav/uploads' ||
strpos($this->request->getPathInfo(), '/dav/uploads/') === 0
);
}

Expand Down

0 comments on commit d8e876c

Please sign in to comment.