Skip to content

Instantly share code, notes, and snippets.

@mrvdb
Last active December 23, 2015 12:29
Show Gist options
  • Save mrvdb/6636130 to your computer and use it in GitHub Desktop.
Save mrvdb/6636130 to your computer and use it in GitHub Desktop.
Fix for !sn log msg: 'Undefined offset: 2 (./lib/activityobject.php:765)'
diff --git a/lib/activityobject.php b/lib/activityobject.php
index 741aefd..3efb36c 100644
--- a/lib/activityobject.php
+++ b/lib/activityobject.php
@@ -633,7 +633,7 @@ class ActivityObject
if ($source->created) {
$object->date = $source->created;
}
$object->extra[] = array('status_net', array('source_code' => $source->code));
Event::handle('EndActivityObjectFromNoticeSource', array($source, &$object));
@@ -660,7 +660,7 @@ class ActivityObject
}
$object->extra[] = array('status_net', array('message_id' => $message->id));
Event::handle('EndActivityObjectFromMessage', array($message, &$object));
}
@@ -762,7 +762,7 @@ class ActivityObject
// @fixme there's no way here to make a tree; elements can only contain plaintext
// @fixme these may collide with JSON extensions
foreach ($this->extra as $el) {
- list($extraTag, $attrs, $content) = $el;
+ list($extraTag, $attrs, $content) = array_pad($el,3,'');
$xo->element($extraTag, $attrs, $content);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment