summaryrefslogtreecommitdiff
path: root/lib/Kolab/DAV/Collection.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Kolab/DAV/Collection.php')
-rw-r--r--lib/Kolab/DAV/Collection.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Kolab/DAV/Collection.php b/lib/Kolab/DAV/Collection.php
index e391162..1a08d1d 100644
--- a/lib/Kolab/DAV/Collection.php
+++ b/lib/Kolab/DAV/Collection.php
@@ -95,6 +95,11 @@ class Collection extends \Kolab\DAV\Node implements \Sabre\DAV\ICollection
*/
public function getChild($name)
{
+ // no support for hidden system files
+ if ($name[0] == '.') {
+ throw new \Sabre\DAV\Exception\NotFound('File not found: ' . $name);
+ }
+
// @TODO: optimise this?
foreach ($this->getChildren() as $child) {
if ($child->getName() == $name) {
@@ -150,6 +155,11 @@ class Collection extends \Kolab\DAV\Node implements \Sabre\DAV\ICollection
*/
public function createFile($name, $data = null)
{
+ // no support for hidden system files
+ if ($name[0] == '.') {
+ throw new \Sabre\DAV\Exception\Forbidden('Hidden files are not accepted');
+ }
+
$filename = $this->path . '/' . $name;
$filedata = $this->fileData($name, $data);
@@ -173,6 +183,11 @@ class Collection extends \Kolab\DAV\Node implements \Sabre\DAV\ICollection
*/
public function createDirectory($name)
{
+ // no support for hidden system files
+ if ($name[0] == '.') {
+ throw new \Sabre\DAV\Exception\Forbidden('Hidden files are not accepted');
+ }
+
$folder = $this->path . '/' . $name;
try {
@@ -185,4 +200,5 @@ class Collection extends \Kolab\DAV\Node implements \Sabre\DAV\ICollection
// reset cache
$this->children = null;
}
+
}