diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2014-02-20 11:53:58 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2014-02-20 11:53:58 +0100 |
commit | 719f1111b636a854d22e8d8a5423629eeb07dc75 (patch) | |
tree | 615036d16a34090b4c9d4dbee439b90018d83d69 /lib/private/connector/sabre/node.php | |
parent | 8114843973d62b33bb9611634b28f220b5b59e2b (diff) | |
parent | bd71a1b7b66f02b3630da44e24b48e29f3d02f17 (diff) | |
download | nextcloud-server-719f1111b636a854d22e8d8a5423629eeb07dc75.tar.gz nextcloud-server-719f1111b636a854d22e8d8a5423629eeb07dc75.zip |
Merge pull request #6714 from owncloud/files-newfileinvalidcharsfix
Added extra checks for invalid file chars in newfile.php and newfolder.php
Diffstat (limited to 'lib/private/connector/sabre/node.php')
-rw-r--r-- | lib/private/connector/sabre/node.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/connector/sabre/node.php b/lib/private/connector/sabre/node.php index 05d2d2291ec..5807c5c7f71 100644 --- a/lib/private/connector/sabre/node.php +++ b/lib/private/connector/sabre/node.php @@ -85,19 +85,24 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr * @return void */ public function setName($name) { + $fs = $this->getFS(); // rename is only allowed if the update privilege is granted - if (!\OC\Files\Filesystem::isUpdatable($this->path)) { + if (!$fs->isUpdatable($this->path)) { throw new \Sabre_DAV_Exception_Forbidden(); } list($parentPath, ) = Sabre_DAV_URLUtil::splitPath($this->path); list(, $newName) = Sabre_DAV_URLUtil::splitPath($name); + if (!\OCP\Util::isValidFileName($newName)) { + throw new \Sabre_DAV_Exception_BadRequest(); + } + $newPath = $parentPath . '/' . $newName; $oldPath = $this->path; - \OC\Files\Filesystem::rename($this->path, $newPath); + $fs->rename($this->path, $newPath); $this->path = $newPath; |