summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2018-08-24 10:42:59 +0200
committerJoas Schilling <coding@schilljs.com>2018-08-24 10:49:08 +0200
commit1eeea993a8db07b1564e267e2682dda375c02e55 (patch)
tree108fc8142447bfe57e62e85028d381e7cb4c82d3 /apps
parent2d5d8b68d215dfdfc7622f8da55e118a3d4a8469 (diff)
downloadnextcloud-server-1eeea993a8db07b1564e267e2682dda375c02e55.tar.gz
nextcloud-server-1eeea993a8db07b1564e267e2682dda375c02e55.zip
Fix mimetype detection for junked uploads
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/workflowengine/lib/Check/FileMimeType.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php
index fe4a83bb906..bd94ec9d5bc 100644
--- a/apps/workflowengine/lib/Check/FileMimeType.php
+++ b/apps/workflowengine/lib/Check/FileMimeType.php
@@ -83,9 +83,13 @@ class FileMimeType extends AbstractStringCheck {
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()) {
@@ -171,7 +175,9 @@ class FileMimeType extends AbstractStringCheck {
$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
);
}