X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Factivityutils.php;h=dcccbb8d878dae2e8960e75b854e711d832286ac;hb=7bef2ad4ccb10a319dde1e62460d34f7ebf3242c;hp=c8e580825173693aa617a010ab35c27ff1914c95;hpb=065e23b1c4dce31f38c2f187be7679066c6f5840;p=quix0rs-gnu-social.git diff --git a/lib/activityutils.php b/lib/activityutils.php index c8e5808251..dcccbb8d87 100644 --- a/lib/activityutils.php +++ b/lib/activityutils.php @@ -301,7 +301,7 @@ class ActivityUtils return false; } - static function getFeedAuthor($feedEl) + static function getFeedAuthor(DOMDocument $feedEl) { // Try old and deprecated activity:subject @@ -350,7 +350,7 @@ class ActivityUtils static function compareTypes($type, $objects) { - $type = self::resolveUri($type); + $type = self::resolveUri($type, false); foreach ((array)$objects as $object) { if ($type === self::resolveUri($object)) { return true; @@ -380,23 +380,24 @@ class ActivityUtils } static function findLocalObject(array $uris, $type=ActivityObject::NOTE) { - $object = null; - // TODO: Extend this in plugins etc. - if (Event::handle('StartFindLocalActivityObject', array($uris, $type, &$object))) { + $obj_class = null; + // TODO: Extend this in plugins etc. and describe in EVENTS.txt + if (Event::handle('StartFindLocalActivityObject', array($uris, $type, &$obj_class))) { switch (self::resolveUri($type)) { case ActivityObject::PERSON: // GROUP will also be here in due time... - $object = new Profile(); + $obj_class = 'Profile'; break; default: - $object = new Notice(); + $obj_class = 'Notice'; } } + $object = null; $uris = array_unique($uris); foreach ($uris as $uri) { try { // the exception thrown will cancel before reaching $object - $object = call_user_func(array($object, 'fromUri'), $uri); + $object = call_user_func("{$obj_class}::fromUri", $uri); break; } catch (UnknownUriException $e) { common_debug('Could not find local activity object from uri: '.$e->object_uri);