Don't accept non-objects before testing with "instanceof".
[quix0rs-gnu-social.git] / plugins / OStatus / lib / huboutqueuehandler.php
index 3ad94646e6ddd98e51b0674b1b3536cd69a3e619..46d9e08e3924922b4b9da6499f24d79c529e47d2 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+if (!defined('STATUSNET')) {
+    exit(1);
+}
+
 /**
  * Send a raw PuSH atom update from our internal hub.
  * @package Hub
@@ -35,6 +39,7 @@ class HubOutQueueHandler extends QueueHandler
         $atom = $data['atom'];
         $retries = $data['retries'];
 
+        assert(is_object($sub));
         assert($sub instanceof HubSub);
         assert(is_string($atom));
 
@@ -45,7 +50,7 @@ class HubOutQueueHandler extends QueueHandler
             $msg = "Failed PuSH to $sub->callback for $sub->topic: " .
                    $e->getMessage();
             if ($retries > 0) {
-                common_log(LOG_ERR, "$msg; scheduling for $retries more tries");
+                common_log(LOG_INFO, "$msg; scheduling for $retries more tries");
 
                 // @fixme when we have infrastructure to schedule a retry
                 // after a delay, use it.