summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-07-20 09:43:23 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-08-01 08:20:17 +0200
commitfc369dd86ea03f3bccb0e1af0686730a0dcb8b9f (patch)
tree62c80517f0882867aaabbc6f7295ec416f8145c2
parentf57a3aa81b27cdc7fbf4595deca9022384aacc91 (diff)
downloadnextcloud-server-fc369dd86ea03f3bccb0e1af0686730a0dcb8b9f.tar.gz
nextcloud-server-fc369dd86ea03f3bccb0e1af0686730a0dcb8b9f.zip
[DAV] Fix URLUtil::splitPath usage
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r--apps/dav/lib/CalDAV/Plugin.php2
-rw-r--r--apps/dav/lib/CardDAV/CardDavBackend.php4
-rw-r--r--apps/dav/lib/CardDAV/Plugin.php6
-rw-r--r--apps/dav/lib/Connector/LegacyDAVACL.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/Directory.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/File.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesPlugin.php6
-rw-r--r--apps/dav/lib/Connector/Sabre/Node.php4
-rw-r--r--apps/dav/lib/Connector/Sabre/ObjectTree.php6
-rw-r--r--apps/dav/lib/Connector/Sabre/Principal.php4
-rw-r--r--apps/dav/lib/Connector/Sabre/QuotaPlugin.php2
-rw-r--r--apps/dav/lib/DAV/SystemPrincipalBackend.php2
-rw-r--r--apps/dav/lib/Files/FilesHome.php2
-rw-r--r--apps/dav/lib/Files/RootCollection.php2
14 files changed, 23 insertions, 23 deletions
diff --git a/apps/dav/lib/CalDAV/Plugin.php b/apps/dav/lib/CalDAV/Plugin.php
index 5172cea6e27..647dbb5c587 100644
--- a/apps/dav/lib/CalDAV/Plugin.php
+++ b/apps/dav/lib/CalDAV/Plugin.php
@@ -31,7 +31,7 @@ class Plugin extends \Sabre\CalDAV\Plugin {
function getCalendarHomeForPrincipal($principalUrl) {
if (strrpos($principalUrl, 'principals/users', -strlen($principalUrl)) !== false) {
- list(, $principalId) = URLUtil::splitPath($principalUrl);
+ list(, $principalId) = \Sabre\Uri\split($principalUrl);
return self::CALENDAR_ROOT .'/' . $principalId;
}
diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php
index 45a695c1869..9dccffc022b 100644
--- a/apps/dav/lib/CardDAV/CardDavBackend.php
+++ b/apps/dav/lib/CardDAV/CardDavBackend.php
@@ -196,7 +196,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
}
}
- list(, $name) = URLUtil::splitPath($row['principaluri']);
+ list(, $name) = \Sabre\Uri\split($row['principaluri']);
$uri = $row['uri'] . '_shared_by_' . $name;
$displayName = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')';
@@ -1091,7 +1091,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
private function convertPrincipal($principalUri, $toV2) {
if ($this->principalBackend->getPrincipalPrefix() === 'principals') {
- list(, $name) = URLUtil::splitPath($principalUri);
+ list(, $name) = \Sabre\Uri\split($principalUri);
if ($toV2 === true) {
return "principals/users/$name";
}
diff --git a/apps/dav/lib/CardDAV/Plugin.php b/apps/dav/lib/CardDAV/Plugin.php
index b291a8360e1..61b9915b1ad 100644
--- a/apps/dav/lib/CardDAV/Plugin.php
+++ b/apps/dav/lib/CardDAV/Plugin.php
@@ -44,15 +44,15 @@ class Plugin extends \Sabre\CardDAV\Plugin {
protected function getAddressbookHomeForPrincipal($principal) {
if (strrpos($principal, 'principals/users', -strlen($principal)) !== false) {
- list(, $principalId) = URLUtil::splitPath($principal);
+ list(, $principalId) = \Sabre\Uri\split($principal);
return self::ADDRESSBOOK_ROOT . '/users/' . $principalId;
}
if (strrpos($principal, 'principals/groups', -strlen($principal)) !== false) {
- list(, $principalId) = URLUtil::splitPath($principal);
+ list(, $principalId) = \Sabre\Uri\split($principal);
return self::ADDRESSBOOK_ROOT . '/groups/' . $principalId;
}
if (strrpos($principal, 'principals/system', -strlen($principal)) !== false) {
- list(, $principalId) = URLUtil::splitPath($principal);
+ list(, $principalId) = \Sabre\Uri\split($principal);
return self::ADDRESSBOOK_ROOT . '/system/' . $principalId;
}
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 = '';
}
diff --git a/apps/dav/lib/DAV/SystemPrincipalBackend.php b/apps/dav/lib/DAV/SystemPrincipalBackend.php
index 6a71909c6fd..8c19e92499d 100644
--- a/apps/dav/lib/DAV/SystemPrincipalBackend.php
+++ b/apps/dav/lib/DAV/SystemPrincipalBackend.php
@@ -163,7 +163,7 @@ class SystemPrincipalBackend extends AbstractBackend {
* @return array
*/
function getGroupMembership($principal) {
- list($prefix, $name) = URLUtil::splitPath($principal);
+ list($prefix, $name) = \Sabre\Uri\split($principal);
if ($prefix === 'principals/system') {
$principal = $this->getPrincipalByPath($principal);
diff --git a/apps/dav/lib/Files/FilesHome.php b/apps/dav/lib/Files/FilesHome.php
index 78fd1f4d6d6..8768d6313b1 100644
--- a/apps/dav/lib/Files/FilesHome.php
+++ b/apps/dav/lib/Files/FilesHome.php
@@ -53,7 +53,7 @@ class FilesHome extends Directory {
}
function getName() {
- list(,$name) = URLUtil::splitPath($this->principalInfo['uri']);
+ list(,$name) = \Sabre\Uri\split($this->principalInfo['uri']);
return $name;
}
diff --git a/apps/dav/lib/Files/RootCollection.php b/apps/dav/lib/Files/RootCollection.php
index c73d7c175ce..66e3160eaf8 100644
--- a/apps/dav/lib/Files/RootCollection.php
+++ b/apps/dav/lib/Files/RootCollection.php
@@ -39,7 +39,7 @@ class RootCollection extends AbstractPrincipalCollection {
* @return INode
*/
function getChildForPrincipal(array $principalInfo) {
- list(,$name) = URLUtil::splitPath($principalInfo['uri']);
+ list(,$name) = \Sabre\Uri\split($principalInfo['uri']);
$user = \OC::$server->getUserSession()->getUser();
if (is_null($user) || $name !== $user->getUID()) {
// a user is only allowed to see their own home contents, so in case another collection