From: Evan Prodromou Date: Fri, 11 Feb 2011 02:59:18 +0000 (+0000) Subject: check legacy and first from feed X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fc317f8b7290be1c89eca6c76739e24ddde27e9b;p=quix0rs-gnu-social.git check legacy and first from feed --- diff --git a/lib/activityutils.php b/lib/activityutils.php index 11befc0ed4..3aa09deb4e 100644 --- a/lib/activityutils.php +++ b/lib/activityutils.php @@ -273,14 +273,6 @@ class ActivityUtils static function getFeedAuthor($feedEl) { - // Try the feed author - - $author = ActivityUtils::child($feedEl, Activity::AUTHOR, Activity::ATOM); - - if (!empty($author)) { - return new ActivityObject($author); - } - // Try old and deprecated activity:subject $subject = ActivityUtils::child($feedEl, Activity::SUBJECT, Activity::SPEC); @@ -289,6 +281,14 @@ class ActivityUtils return new ActivityObject($subject); } + // Try the feed author + + $author = ActivityUtils::child($feedEl, Activity::AUTHOR, Activity::ATOM); + + if (!empty($author)) { + return new ActivityObject($author); + } + // Sheesh. Not a very nice feed! Let's try fingerpoken in the // entries. @@ -298,14 +298,6 @@ class ActivityUtils $entry = $entries->item(0); - // Try the author - - $author = ActivityUtils::child($entry, Activity::AUTHOR, Activity::ATOM); - - if (!empty($author)) { - return new ActivityObject($author); - } - // Try the (deprecated) activity:actor $actor = ActivityUtils::child($entry, Activity::ACTOR, Activity::SPEC); @@ -313,6 +305,14 @@ class ActivityUtils if (!empty($actor)) { return new ActivityObject($actor); } + + // Try the author + + $author = ActivityUtils::child($entry, Activity::AUTHOR, Activity::ATOM); + + if (!empty($author)) { + return new ActivityObject($author); + } } return null;