diff --git a/apps/dav/lib/CalDAV/Plugin.php b/apps/dav/lib/CalDAV/Plugin.php index 5172cea6e2..647dbb5c58 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 45a695c186..9dccffc022 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 b291a8360e..61b9915b1a 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 46cbb504cc..704b967a00 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 cb5a2ab812..1a97d89646 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 ab04890d6c..63f10034ed 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 c039928ead..d4aa277fdc 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 06933f53e7..b6d4090bf8 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 acc6dcc3be..d298d6be84 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 8713f61767..dfcbf1e1ca 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 f0958c353a..92f1f6e2e7 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 6a71909c6f..8c19e92499 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 78fd1f4d6d..8768d6313b 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 c73d7c175c..66e3160eaf 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