forked from GNUsocial/gnu-social
correctly return oprofile from Ostatus_profile::ensureProfileURI()
This commit is contained in:
parent
974ac48771
commit
ab88123373
@ -1770,22 +1770,31 @@ class Ostatus_profile extends Memcached_DataObject
|
||||
{
|
||||
$oprofile = null;
|
||||
|
||||
if (preg_match("/^(\w+)\:(.*)/", $uri, $match)) {
|
||||
$protocol = $match[1];
|
||||
switch ($protocol) {
|
||||
case 'http':
|
||||
case 'https':
|
||||
$oprofile = Ostatus_profile::ensureProfileURL($uri);
|
||||
break;
|
||||
case 'acct':
|
||||
case 'mailto':
|
||||
$rest = $match[2];
|
||||
$oprofile = Ostatus_profile::ensureWebfinger($rest);
|
||||
default:
|
||||
common_log("Unrecognized URI protocol for profile: $protocol ($uri)");
|
||||
break;
|
||||
// First, try to query it
|
||||
|
||||
$oprofile = Ostatus_profile::staticGet('uri', $uri);
|
||||
|
||||
// If unfound, do discovery stuff
|
||||
|
||||
if (empty($oprofile)) {
|
||||
if (preg_match("/^(\w+)\:(.*)/", $uri, $match)) {
|
||||
$protocol = $match[1];
|
||||
switch ($protocol) {
|
||||
case 'http':
|
||||
case 'https':
|
||||
$oprofile = Ostatus_profile::ensureProfileURL($uri);
|
||||
break;
|
||||
case 'acct':
|
||||
case 'mailto':
|
||||
$rest = $match[2];
|
||||
$oprofile = Ostatus_profile::ensureWebfinger($rest);
|
||||
default:
|
||||
common_log("Unrecognized URI protocol for profile: $protocol ($uri)");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $oprofile;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user