diff --git a/lib/KaraDAV/Storage.php b/lib/KaraDAV/Storage.php index 4a56090..60618ac 100644 --- a/lib/KaraDAV/Storage.php +++ b/lib/KaraDAV/Storage.php @@ -281,7 +281,7 @@ class Storage extends AbstractStorage implements TrashInterface throw new WebDAV_Exception('Target is a directory', 409); } - $this->ensureDirectoryExists($uri); + $this->ensureDirectoryExists($parent); $new = !file_exists($target); @@ -293,6 +293,10 @@ class Storage extends AbstractStorage implements TrashInterface $size = 0; $quota = $this->users->quota($this->users->current()); + if ($quota->free <= 0) { + throw new WebDAV_Exception('Your quota is exhausted', 403); + } + $tmp_dir = sprintf(STORAGE_PATH, '_tmp'); if (!file_exists($tmp_dir)) { @@ -399,7 +403,7 @@ class Storage extends AbstractStorage implements TrashInterface $method = $move ? 'rename' : 'copy'; if ($method == 'copy' && is_dir($source)) { - $this->ensureDirectoryExists($destination); + $this->ensureDirectoryExists($parent); if (!is_dir($target)) { throw new WebDAV_Exception('Target directory could not be created', 409);