Issues

ZF-8656: getPagesInRange($lowerBound, $upperBound) gets floats passed instead of int

Description

the function getPagesInRange($lowerBound, $upperBound) gets sometimes passed float type arguments instead of int's. this causes the function to never complete because the the for loop never reaches its exit-condition.

system: win32 vista / php 5.3.0 / apache 2.2.11 / mysqld (various versions)

Comments

an int - typecast in the style of: $lowerBound = $this->normalizePageNumber( (int)$lowerBound); $upperBound = $this->normalizePageNumber( (int)$upperBound); solves the issue.

Modified methods normalizeItemNumber() and normalizePageNumber() adding an integer cast which forces all into into an integer (e.g. 1.5 => 1). Also added two unit tests checking return values when given float values as input for normalizeItemNumber() and normalizePageNumber().

Patch applied: Modified methods normalizeItemNumber() and normalizePageNumber() adding an integer cast which forces all into into an integer (e.g. 1.5 => 1). Also added two unit tests checking return values when given float values as input for normalizeItemNumber() and normalizePageNumber().

Implemented with r22257.

merged into branches/release-1.9 and branches/release-1.10