]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixes files_drop for sabre 3.2 2082/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Thu, 10 Nov 2016 19:44:41 +0000 (20:44 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Thu, 10 Nov 2016 19:44:41 +0000 (20:44 +0100)
In the new sabre (3.2) the order of beforeMethod is switched. it used to
be that beforeMethod:METHOD was called after beforeMethod. But now it is
called before. Since we need the view this was broken.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
apps/dav/lib/Files/Sharing/FilesDropPlugin.php

index ccfa452cb68833a1e3fd6e09b26197e1c1031634..299427b16346e2444ee7cbf7454c78923310d328 100644 (file)
@@ -58,13 +58,13 @@ class FilesDropPlugin extends ServerPlugin {
         * @return void
         */
        public function initialize(\Sabre\DAV\Server $server) {
-               $server->on('beforeMethod:PUT', [$this, 'beforeMethod']);
+               $server->on('beforeMethod', [$this, 'beforeMethod'], 999);
                $this->enabled = false;
        }
 
        public function beforeMethod(RequestInterface $request, ResponseInterface $response){
 
-               if (!$this->enabled) {
+               if (!$this->enabled || $request->getMethod() !== 'PUT') {
                        return;
                }