]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Type controlling in lib/atomnoticefeed.php
authorMikael Nordfeldth <mmn@hethane.se>
Thu, 9 Jul 2015 11:56:02 +0000 (13:56 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Thu, 9 Jul 2015 11:56:02 +0000 (13:56 +0200)
lib/atomnoticefeed.php

index 292bc97e8584ccfe0819bb93522d175051a5451d..b7e1ed1b41c1178cb8b1ff1f44c4b670f3f06f19 100644 (file)
@@ -113,10 +113,12 @@ class AtomNoticeFeed extends Atom10Feed
             foreach ($notices as $notice) {
                 $this->addEntryFromNotice($notice);
             }
-        } else {
+        } elseif ($notices instanceof Notice) {
             while ($notices->fetch()) {
                 $this->addEntryFromNotice($notices);
             }
+        } else {
+            throw new ServerException('addEntryFromNotices got neither an array nor a Notice object');
         }
     }
 
@@ -125,7 +127,7 @@ class AtomNoticeFeed extends Atom10Feed
      *
      * @param Notice $notice a Notice to add
      */
-    function addEntryFromNotice($notice)
+    function addEntryFromNotice(Notice $notice)
     {
         try {
             $source = $this->showSource();