]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/filteringnoticestream.php
make sure we have an integer value for askFor
[quix0rs-gnu-social.git] / lib / filteringnoticestream.php
index b5def44da7ad092cc71b595e1f012f8bd89fcd68..9996578233b978516cab961c347816b84a322aeb 100644 (file)
@@ -108,7 +108,7 @@ abstract class FilteringNoticeStream extends NoticeStream
             if ($hits === 0) {
                 $askFor = max(min(2 * $askFor, NOTICES_PER_PAGE * 50), NOTICES_PER_PAGE);
             } else {
-                $askFor = max(min((($total - $hits)*$startAt)/$hits, NOTICES_PER_PAGE * 50), NOTICES_PER_PAGE);
+                $askFor = max(min(intval(ceil(($total - $hits)*$startAt/$hits)), NOTICES_PER_PAGE * 50), NOTICES_PER_PAGE);
             }
 
             common_debug(get_class($this) . ": ($offset, $limit) Round $round hits is $hits, results = $results.");