@@ -154,6 +154,7 @@ public function getPrincipalsByPrefix($prefixPath) {
154154 */
155155 public function getPrincipalByPath ($ path ) {
156156 list ($ prefix , $ name ) = \Sabre \Uri \split ($ path );
157+ $ name = urldecode ($ name );
157158
158159 if ($ name === 'calendar-proxy-write ' || $ name === 'calendar-proxy-read ' ) {
159160 list ($ prefix2 , $ name2 ) = \Sabre \Uri \split ($ prefix );
@@ -175,7 +176,7 @@ public function getPrincipalByPath($path) {
175176 // is called either with a urlencoded version of the name or with a non-urlencoded one.
176177 // The urldecode function replaces %## and +, both of which are forbidden in usernames.
177178 // Hence there can be no ambiguity here and it is safe to call urldecode on all usernames
178- $ user = $ this ->userManager ->get (urldecode ( $ name) );
179+ $ user = $ this ->userManager ->get ($ name );
179180
180181 if ($ user !== null ) {
181182 return $ this ->userToPrincipal ($ user );
@@ -184,6 +185,14 @@ public function getPrincipalByPath($path) {
184185 if ($ this ->userSession ->getUser () !== null ) {
185186 return $ this ->circleToPrincipal ($ name );
186187 }
188+ } elseif ($ prefix === 'principals/groups ' ) {
189+ if ($ this ->hasGroups && $ this ->groupManager ->groupExists ($ name )) {
190+ $ group = $ this ->groupManager ->get ($ name );
191+ return [
192+ 'uri ' => 'principals/groups/ ' . $ name ,
193+ '{DAV:}displayname ' => $ group ->getDisplayName (),
194+ ];
195+ }
187196 }
188197 return null ;
189198 }
0 commit comments