special case for parsing embedded activities in SHARE verb
This commit is contained in:
parent
982426a790
commit
22b565a937
|
@ -135,6 +135,9 @@ class Activity
|
||||||
} else if ($entry->namespaceURI == Activity::RSS &&
|
} else if ($entry->namespaceURI == Activity::RSS &&
|
||||||
$entry->localName == 'item') {
|
$entry->localName == 'item') {
|
||||||
$this->_fromRssItem($entry, $feed);
|
$this->_fromRssItem($entry, $feed);
|
||||||
|
} else if ($entry->namespaceURI == Activity::SPEC &&
|
||||||
|
$entry->localName == 'object') {
|
||||||
|
$this->_fromAtomEntry($entry, $feed);
|
||||||
} else {
|
} else {
|
||||||
// Low level exception. No need for i18n.
|
// Low level exception. No need for i18n.
|
||||||
throw new Exception("Unknown DOM element: {$entry->namespaceURI} {$entry->localName}");
|
throw new Exception("Unknown DOM element: {$entry->namespaceURI} {$entry->localName}");
|
||||||
|
@ -173,9 +176,16 @@ class Activity
|
||||||
if ($objectEls->length > 0) {
|
if ($objectEls->length > 0) {
|
||||||
for ($i = 0; $i < $objectEls->length; $i++) {
|
for ($i = 0; $i < $objectEls->length; $i++) {
|
||||||
$objectEl = $objectEls->item($i);
|
$objectEl = $objectEls->item($i);
|
||||||
|
// Special case for embedded activities
|
||||||
|
$objectType = ActivityUtils::childContent($objectEl, self::OBJECTTYPE, self::SPEC);
|
||||||
|
if (!empty($objectType) && $objectType == ActivityObject::ACTIVITY) {
|
||||||
|
$this->objects[] = new Activity($objectEl);
|
||||||
|
} else {
|
||||||
$this->objects[] = new ActivityObject($objectEl);
|
$this->objects[] = new ActivityObject($objectEl);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// XXX: really?
|
||||||
$this->objects[] = new ActivityObject($entry);
|
$this->objects[] = new ActivityObject($entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user