Fixes files_drop for sabre 3.2

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>
This commit is contained in:
Roeland Jago Douma 2016-11-10 20:44:41 +01:00
parent 8cfdcfb40d
commit 4b3b562c4f
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
1 changed files with 2 additions and 2 deletions

View 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;
}