From: Evan Prodromou Date: Thu, 22 Mar 2012 02:53:02 +0000 (-0400) Subject: make sure we have an integer value for askFor X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7e76d116d86d652d5c9f81a516a85edade4d7614;hp=8981a420c19106686e253111464e62c99bc82334;p=quix0rs-gnu-social.git make sure we have an integer value for askFor --- 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.");