]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
make sure we have an integer value for askFor
authorEvan Prodromou <evan@status.net>
Thu, 22 Mar 2012 02:53:02 +0000 (22:53 -0400)
committerEvan Prodromou <evan@status.net>
Thu, 22 Mar 2012 02:53:14 +0000 (22:53 -0400)
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.");