Prevent deleting Webdav root

This commit is contained in:
Vincent Petry 2015-06-05 16:21:55 +02:00
parent ddd067a414
commit 6ae5ae2e31

View file

@ -230,7 +230,7 @@ class Directory extends \OC\Connector\Sabre\Node
*/
public function delete() {
if (!$this->info->isDeletable()) {
if ($this->path === '' || $this->path === '/' || !$this->info->isDeletable()) {
throw new \Sabre\DAV\Exception\Forbidden();
}