From: Evan Prodromou <evan@e14n.com>
Date: Tue, 4 Jun 2013 19:20:21 +0000 (-0400)
Subject: Better handling of multiple objects
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a23290883bbc81c73fc5395b077486257ed7eb8e;p=quix0rs-gnu-social.git

Better handling of multiple objects
---

diff --git a/lib/activity.php b/lib/activity.php
index 3b7a4d2aaa..592c56bcbd 100644
--- a/lib/activity.php
+++ b/lib/activity.php
@@ -375,11 +375,12 @@ class Activity
 
         // object
 
-        if (count($this->objects) > 1) {
-            common_log(LOG_WARNING, "Ignoring extra objects in JSON output for activity " . $this->id);
-        } else if (count($this->objects == 0)) {
+        if (count($this->objects) == 0) {
             common_log(LOG_ERR, "Can't save " . $this->id);
         } else {
+            if (count($this->objects) > 1) {
+                common_log(LOG_WARNING, "Ignoring " . (count($this->objects) - 1) . " extra objects in JSON output for activity " . $this->id);
+            }
             $object = $this->objects[0];
 
             if ($object instanceof Activity) {