diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2017-01-09 21:20:55 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-02-27 17:07:18 +0100 |
commit | c75b5a56140605308237d94038947b1b27941521 (patch) | |
tree | 3f5fd18273e0e5cd0f9bd6e677c3391736ad2d3a /apps/dav/lib/DAV | |
parent | 019574014702657fa34acac4a631f78e27c20db8 (diff) | |
download | nextcloud-server-c75b5a56140605308237d94038947b1b27941521.tar.gz nextcloud-server-c75b5a56140605308237d94038947b1b27941521.zip |
Properly handle groups with a /
If a group contains a slash the principal URI becomes
principals/groups/foo/bar. Now the URI is plit on '/' so this creates
issues ;)
Fixes #2957
* Add tests for groups with /
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/lib/DAV')
-rw-r--r-- | apps/dav/lib/DAV/GroupPrincipalBackend.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/dav/lib/DAV/GroupPrincipalBackend.php b/apps/dav/lib/DAV/GroupPrincipalBackend.php index f8dc1e60881..f6295d3b386 100644 --- a/apps/dav/lib/DAV/GroupPrincipalBackend.php +++ b/apps/dav/lib/DAV/GroupPrincipalBackend.php @@ -76,14 +76,14 @@ class GroupPrincipalBackend implements BackendInterface { * @return array */ public function getPrincipalByPath($path) { - $elements = explode('/', $path); + $elements = explode('/', $path, 3); if ($elements[0] !== 'principals') { return null; } if ($elements[1] !== 'groups') { return null; } - $name = $elements[2]; + $name = urldecode($elements[2]); $group = $this->groupManager->get($name); if (!is_null($group)) { @@ -179,7 +179,7 @@ class GroupPrincipalBackend implements BackendInterface { protected function groupToPrincipal($group) { $groupId = $group->getGID(); $principal = [ - 'uri' => "principals/groups/$groupId", + 'uri' => 'principals/groups/' . urlencode($groupId), '{DAV:}displayname' => $groupId, ]; |