Esempio n. 1
0
 /**
  * Get the identifier URI for the remote entity described
  * by this ActivityObject. This URI is *not* guaranteed to be
  * a resolvable HTTP/HTTPS URL.
  *
  * @param ActivityObject $object
  * @return string
  * @throws ServerException if feed info invalid
  */
 protected static function getActivityObjectProfileURI(ActivityObject $object)
 {
     if ($object->id) {
         if (ActivityUtils::validateUri($object->id)) {
             return $object->id;
         }
     }
     // If the id is missing or invalid (we've seen feeds mistakenly listing
     // things like local usernames in that field) then we'll use the profile
     // page link, if valid.
     if ($object->link && common_valid_http_url($object->link)) {
         return $object->link;
     }
     // TRANS: Server exception.
     throw new ServerException(_m('No author ID URI found.'));
 }