Skip to content
Snippets Groups Projects
Unverified Commit b5204a78 authored by Georg Ehrke's avatar Georg Ehrke
Browse files

Mitigate encoding issue with user principal uri

parent a89c8a25
No related branches found
No related tags found
No related merge requests found
...@@ -168,7 +168,11 @@ class Principal implements BackendInterface { ...@@ -168,7 +168,11 @@ class Principal implements BackendInterface {
} }
if ($prefix === $this->principalPrefix) { if ($prefix === $this->principalPrefix) {
$user = $this->userManager->get($name); // Depending on where it is called, it may happen that this function
// is called either with a urlencoded version of the name or with a non-urlencoded one.
// The urldecode function replaces %## and +, both of which are forbidden in usernames.
// Hence there can be no ambiguity here and it is safe to call urldecode on all usernames
$user = $this->userManager->get(urldecode($name));
if ($user !== null) { if ($user !== null) {
return $this->userToPrincipal($user); return $this->userToPrincipal($user);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment