From: Mikael Nordfeldth Date: Sun, 21 Feb 2016 18:09:39 +0000 (+0100) Subject: Claim that we are the URL without index.php/ in webfinger response X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1edb1bbc174669aa8e8eb444aba60d86f99cdb84;p=quix0rs-gnu-social.git Claim that we are the URL without index.php/ in webfinger response --- diff --git a/plugins/WebFinger/lib/webfingerresource.php b/plugins/WebFinger/lib/webfingerresource.php index 90b818add1..0445b9a0a2 100644 --- a/plugins/WebFinger/lib/webfingerresource.php +++ b/plugins/WebFinger/lib/webfingerresource.php @@ -47,6 +47,20 @@ abstract class WebFingerResource // getUrl failed because no valid URL could be returned, just ignore it } + // We claim that we are for example https://site.example/user/1 even if the client + // requests https://site.example/index.php/user/1 due to behaviour seen in the wild. + foreach(array_keys($aliases) as $alias) { + try { + // get a "fancy url" version of the alias, even without index.php/ + $fancy_url = common_fake_local_fancy_url($alias); + // store this as well so remote sites can be sure we really are the same profile + $aliases[$fancy_url] = true; + } catch (Exception $e) { + // in case we couldn't make a "fake local fancy URL", just continue the foreach-loop + continue; + } + } + // return a unique set of aliases by extracting only the keys return array_keys($aliases); }