summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/OStatus/classes/Ostatus_profile.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index b43a2b5f1..e5b8939a9 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':