From 7e76d116d86d652d5c9f81a516a85edade4d7614 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 21 Mar 2012 22:53:02 -0400 Subject: [PATCH] make sure we have an integer value for askFor --- lib/filteringnoticestream.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/filteringnoticestream.php b/lib/filteringnoticestream.php index b5def44da7..9996578233 100644 --- a/lib/filteringnoticestream.php +++ b/lib/filteringnoticestream.php @@ -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."); -- 2.39.2