X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FOStatus%2Fclasses%2FOstatus_profile.php;h=e5b8939a9d3a78b0d387ff9dadb8ef5e39dc2142;hb=0330bad688e902df7c4a6f0db7faed52b9ccfbcb;hp=b43a2b5f11fde33c05d8524808dd0e4def553117;hpb=eb0495d10719f2be86f8f97e82aaa1b8bf923c7d;p=quix0rs-gnu-social.git diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index b43a2b5f11..e5b8939a9d 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -1552,8 +1552,11 @@ class Ostatus_profile extends Memcached_DataObject } // Try the profile url (like foo.example.com or example.com/user/foo) - - $profileUrl = ($object->link) ? $object->link : $hints['profileurl']; + if (!empty($object->link)) { + $profileUrl = $object->link; + } else if (!empty($hints['profileurl'])) { + $profileUrl = $hints['profileurl']; + } if (!empty($profileUrl)) { $nickname = self::nicknameFromURI($profileUrl); @@ -1584,9 +1587,11 @@ class Ostatus_profile extends Memcached_DataObject protected static function nicknameFromURI($uri) { - preg_match('/(\w+):/', $uri, $matches); - - $protocol = $matches[1]; + if (preg_match('/(\w+):/', $uri, $matches)) { + $protocol = $matches[1]; + } else { + return null; + } switch ($protocol) { case 'acct':