From: Joshua Judson Rosen Date: Tue, 9 Dec 2014 02:55:51 +0000 (-0500) Subject: Parse remote users' fullnames from PoCo::displayName elements X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=238095a719446b2887a1c0baa9abe4cf1a59fd39;p=quix0rs-gnu-social.git Parse remote users' fullnames from PoCo::displayName elements Try this first; use activity:subject->atom:title only as a fallback. The code that output activity:subject was removed 2013-10-08, and it it was deprecated for years before that.... --- diff --git a/lib/activityobject.php b/lib/activityobject.php index 7fe5c4850c..9a6218de3a 100644 --- a/lib/activityobject.php +++ b/lib/activityobject.php @@ -195,15 +195,22 @@ class ActivityObject $this->type = self::PERSON; // XXX: is this fair? } - // start with - $title = ActivityUtils::childHtmlContent($element, self::TITLE); + // Start with - if (!empty($title)) { - $this->title = common_strip_html($title); + $this->title = ActivityUtils::childContent($element, PoCo::DISPLAYNAME, PoCo::NS); + + // try falling back to + + if (empty($this->title)) { + $title = ActivityUtils::childHtmlContent($element, self::TITLE); + + if (!empty($title)) { + $this->title = common_strip_html($title); + } } - // fall back to + // fall back to as a last resort if (empty($this->title)) { $this->title = $this->_childContent($element, self::NAME);