From c5742124220518908ccc4bce1fd3179909aaf2b9 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 24 Aug 2018 10:42:59 +0200 Subject: [PATCH] Fix mimetype detection for junked uploads Signed-off-by: Joas Schilling --- apps/workflowengine/lib/Check/FileMimeType.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php index fe4a83bb90663..bd94ec9d5bc34 100644 --- a/apps/workflowengine/lib/Check/FileMimeType.php +++ b/apps/workflowengine/lib/Check/FileMimeType.php @@ -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()) { @@ -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 ); }