git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 0c17c322 authored by mmn's avatar mmn

Let the WebFingerPlugin lookup profile resources with index.php/ too

parent 23e66bef
......@@ -100,12 +100,21 @@ class WebFingerPlugin extends Plugin
}
}
} else {
$user = User::getKV('uri', $resource);
if ($user instanceof User) {
try {
$user = User::getByUri($resource);
$profile = $user->getProfile();
} else {
// try and get it by profile url
$profile = Profile::getKV('profileurl', $resource);
} catch (NoResultException $e) {
try {
// common_fake_local_fancy_url can throw an exception
$fancy_url = common_fake_local_fancy_url($resource);
// and this will throw a NoResultException if not found
$user = User::getByUri($fancy_url);
$profile = $user->getProfile();
} catch (Exception $e) {
// if our rewrite hack didn't work, try to get something by profile URL
$profile = Profile::getKV('profileurl', $resource);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment