diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2017-07-20 09:43:23 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-08-01 08:20:17 +0200 |
commit | fc369dd86ea03f3bccb0e1af0686730a0dcb8b9f (patch) | |
tree | 62c80517f0882867aaabbc6f7295ec416f8145c2 /apps/dav/lib/Connector | |
parent | f57a3aa81b27cdc7fbf4595deca9022384aacc91 (diff) | |
download | nextcloud-server-fc369dd86ea03f3bccb0e1af0686730a0dcb8b9f.tar.gz nextcloud-server-fc369dd86ea03f3bccb0e1af0686730a0dcb8b9f.zip |
[DAV] Fix URLUtil::splitPath usage
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/lib/Connector')
-rw-r--r-- | apps/dav/lib/Connector/LegacyDAVACL.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Directory.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/File.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/FilesPlugin.php | 6 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Node.php | 4 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/ObjectTree.php | 6 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Principal.php | 4 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/QuotaPlugin.php | 2 |
8 files changed, 14 insertions, 14 deletions
diff --git a/apps/dav/lib/Connector/LegacyDAVACL.php b/apps/dav/lib/Connector/LegacyDAVACL.php index 46cbb504cce..704b967a002 100644 --- a/apps/dav/lib/Connector/LegacyDAVACL.php +++ b/apps/dav/lib/Connector/LegacyDAVACL.php @@ -51,7 +51,7 @@ class LegacyDAVACL extends DavAclPlugin { } private function convertPrincipal($principal, $toV2) { - list(, $name) = URLUtil::splitPath($principal); + list(, $name) = \Sabre\Uri\split($principal); if ($toV2) { return "principals/users/$name"; } diff --git a/apps/dav/lib/Connector/Sabre/Directory.php b/apps/dav/lib/Connector/Sabre/Directory.php index cb5a2ab8123..1a97d896469 100644 --- a/apps/dav/lib/Connector/Sabre/Directory.php +++ b/apps/dav/lib/Connector/Sabre/Directory.php @@ -387,7 +387,7 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node throw new \Sabre\DAV\Exception\Forbidden('Could not copy directory ' . $sourceNode->getName() . ', target exists'); } - list($sourceDir,) = \Sabre\HTTP\URLUtil::splitPath($sourceNode->getPath()); + list($sourceDir,) = \Sabre\Uri\split($sourceNode->getPath()); $destinationDir = $this->getPath(); $sourcePath = $sourceNode->getPath(); diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index ab04890d6c7..63f10034ed6 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -396,7 +396,7 @@ class File extends Node implements IFile { * @throws ServiceUnavailable */ private function createFileChunked($data) { - list($path, $name) = \Sabre\HTTP\URLUtil::splitPath($this->path); + list($path, $name) = \Sabre\Uri\split($this->path); $info = \OC_FileChunking::decodeName($name); if (empty($info)) { diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index c039928eadd..d4aa277fdc8 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -196,8 +196,8 @@ class FilesPlugin extends ServerPlugin { if (!$sourceNode instanceof Node) { return; } - list($sourceDir,) = \Sabre\HTTP\URLUtil::splitPath($source); - list($destinationDir,) = \Sabre\HTTP\URLUtil::splitPath($destination); + list($sourceDir,) = \Sabre\Uri\split($source); + list($destinationDir,) = \Sabre\Uri\split($destination); if ($sourceDir !== $destinationDir) { $sourceNodeFileInfo = $sourceNode->getFileInfo(); @@ -432,7 +432,7 @@ class FilesPlugin extends ServerPlugin { public function sendFileIdHeader($filePath, \Sabre\DAV\INode $node = null) { // chunked upload handling if (isset($_SERVER['HTTP_OC_CHUNKED'])) { - list($path, $name) = \Sabre\HTTP\URLUtil::splitPath($filePath); + list($path, $name) = \Sabre\Uri\split($filePath); $info = \OC_FileChunking::decodeName($name); if (!empty($info)) { $filePath = $path . '/' . $info['name']; diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php index 06933f53e76..b6d4090bf8f 100644 --- a/apps/dav/lib/Connector/Sabre/Node.php +++ b/apps/dav/lib/Connector/Sabre/Node.php @@ -126,8 +126,8 @@ abstract class Node implements \Sabre\DAV\INode { throw new \Sabre\DAV\Exception\Forbidden(); } - list($parentPath,) = \Sabre\HTTP\URLUtil::splitPath($this->path); - list(, $newName) = \Sabre\HTTP\URLUtil::splitPath($name); + list($parentPath,) = \Sabre\Uri\split($this->path); + list(, $newName) = \Sabre\Uri\split($name); // verify path of the target $this->verifyPath(); diff --git a/apps/dav/lib/Connector/Sabre/ObjectTree.php b/apps/dav/lib/Connector/Sabre/ObjectTree.php index acc6dcc3be3..d298d6be842 100644 --- a/apps/dav/lib/Connector/Sabre/ObjectTree.php +++ b/apps/dav/lib/Connector/Sabre/ObjectTree.php @@ -80,7 +80,7 @@ class ObjectTree extends \Sabre\DAV\Tree { private function resolveChunkFile($path) { if (isset($_SERVER['HTTP_OC_CHUNKED'])) { // resolve to real file name to find the proper node - list($dir, $name) = \Sabre\HTTP\URLUtil::splitPath($path); + list($dir, $name) = \Sabre\Uri\split($path); if ($dir == '/' || $dir == '.') { $dir = ''; } @@ -221,7 +221,7 @@ class ObjectTree extends \Sabre\DAV\Tree { // this will trigger existence check $this->getNodeForPath($source); - list($destinationDir, $destinationName) = \Sabre\HTTP\URLUtil::splitPath($destination); + list($destinationDir, $destinationName) = \Sabre\Uri\split($destination); try { $this->fileView->verifyPath($destinationDir, $destinationName); } catch (\OCP\Files\InvalidPathException $ex) { @@ -238,7 +238,7 @@ class ObjectTree extends \Sabre\DAV\Tree { throw new FileLocked($e->getMessage(), $e->getCode(), $e); } - list($destinationDir,) = \Sabre\HTTP\URLUtil::splitPath($destination); + list($destinationDir,) = \Sabre\Uri\split($destination); $this->markDirty($destinationDir); } } diff --git a/apps/dav/lib/Connector/Sabre/Principal.php b/apps/dav/lib/Connector/Sabre/Principal.php index 8713f61767b..dfcbf1e1ca0 100644 --- a/apps/dav/lib/Connector/Sabre/Principal.php +++ b/apps/dav/lib/Connector/Sabre/Principal.php @@ -100,7 +100,7 @@ class Principal implements BackendInterface { * @return array */ public function getPrincipalByPath($path) { - list($prefix, $name) = URLUtil::splitPath($path); + list($prefix, $name) = \Sabre\Uri\split($path); if ($prefix === $this->principalPrefix) { $user = $this->userManager->get($name); @@ -138,7 +138,7 @@ class Principal implements BackendInterface { * @throws Exception */ public function getGroupMembership($principal, $needGroups = false) { - list($prefix, $name) = URLUtil::splitPath($principal); + list($prefix, $name) = \Sabre\Uri\split($principal); if ($prefix === $this->principalPrefix) { $user = $this->userManager->get($name); diff --git a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php index f0958c353a1..92f1f6e2e74 100644 --- a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php +++ b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php @@ -91,7 +91,7 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin { if (substr($uri, 0, 1) !== '/') { $uri = '/' . $uri; } - list($parentUri, $newName) = URLUtil::splitPath($uri); + list($parentUri, $newName) = \Sabre\Uri\split($uri); if(is_null($parentUri)) { $parentUri = ''; } |