summaryrefslogtreecommitdiff
path: root/lib/activityobject.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-03-22 18:54:46 -0700
committerZach Copley <zach@status.net>2010-03-22 18:54:46 -0700
commit073e3a1572d0cd5934c6578f4245c39e8376351f (patch)
treeed3d62de6faa49803f54c378d8fa2ce49365e9a5 /lib/activityobject.php
parenta0a9acb9a284910e6b7dd95c847e8226dde7732d (diff)
parent3678e7b89bd0cc683c98369e5dec3b940134532b (diff)
Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
* 'testing' of gitorious.org:statusnet/mainline: OStatus remote sending test cases. Doesn't actually run within PHPUnit right now, must be run from command line -- specify base URLs to two StatusNet sites that will be able to communicate with each other. Math_BigInteger doesn't correctly handle serialization/deserialization for a value of 0, which can end up spewing notices to output and otherwise intefering with Salmon signature setup and verification when using memcached. Log backtraces for non-ClientException exceptions caught at the top-level handler. Confirm there's actually user and domain portions of acct string before assigning things from output of explode(); avoids notice message when invalid input passed to main/xrd Fixing HTTP Header LRDD parsing (sites in subdirectories need this) Replace the "give up and dump object" attachment view fallback with a client-side redirect to the target URL, which will at least be useful. ignore unrecognized object types Pull <atom:author> info as well as <activity:actor> when we have an old-style ActivityStreams feed. This fixes subscription setup for Cliqset feeds, which currently have a bogus activity:actor/atom:id but a good atom:author/atom:uri Accept 'tag' and other non-http id URIs in Ostatus_profile::getActivityObjectProfileURI().
Diffstat (limited to 'lib/activityobject.php')
-rw-r--r--lib/activityobject.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/activityobject.php b/lib/activityobject.php
index e5cea727b..0a358ccab 100644
--- a/lib/activityobject.php
+++ b/lib/activityobject.php
@@ -156,7 +156,11 @@ class ActivityObject
{
$this->type = self::PERSON; // XXX: is this fair?
$this->title = $this->_childContent($element, self::NAME);
- $this->id = $this->_childContent($element, self::URI);
+
+ $id = $this->_childContent($element, self::URI);
+ if (ActivityUtils::validateUri($id)) {
+ $this->id = $id;
+ }
if (empty($this->id)) {
$email = $this->_childContent($element, self::EMAIL);
@@ -169,6 +173,15 @@ class ActivityObject
private function _fromAtomEntry($element)
{
+ if ($element->localName == 'actor') {
+ // Old-fashioned <activity:actor>...
+ // First pull anything from <author>, then we'll add on top.
+ $author = ActivityUtils::child($element->parentNode, 'author');
+ if ($author) {
+ $this->_fromAuthor($author);
+ }
+ }
+
$this->type = $this->_childContent($element, Activity::OBJECTTYPE,
Activity::SPEC);
@@ -176,7 +189,11 @@ class ActivityObject
$this->type = ActivityObject::NOTE;
}
- $this->id = $this->_childContent($element, self::ID);
+ $id = $this->_childContent($element, self::ID);
+ if (ActivityUtils::validateUri($id)) {
+ $this->id = $id;
+ }
+
$this->summary = ActivityUtils::childHtmlContent($element, self::SUMMARY);
$this->content = ActivityUtils::getContent($element);