]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Better handling of multiple objects
authorEvan Prodromou <evan@e14n.com>
Tue, 4 Jun 2013 19:20:21 +0000 (15:20 -0400)
committerEvan Prodromou <evan@e14n.com>
Tue, 4 Jun 2013 19:21:59 +0000 (15:21 -0400)
lib/activity.php

index 3b7a4d2aaa484c53198e7e82a9e3749f4af9a76a..592c56bcbd1bc85f61916c779c4f7824120f212e 100644 (file)
@@ -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) {