fix types in http_range support

This commit is contained in:
Shish 2020-02-01 11:58:05 +00:00
parent fb4a07a3d6
commit 135b8db720

View File

@ -389,11 +389,11 @@ class BasePage
break;
}
if ($range == '-') {
$c_start = $size - substr($range, 1);
$c_start = $size - (int)substr($range, 1);
} else {
$range = explode('-', $range);
$c_start = $range[0];
$c_end = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $size;
$c_start = (int)$range[0];
$c_end = (isset($range[1]) && is_numeric($range[1])) ? (int)$range[1] : $size;
}
$c_end = ($c_end > $end) ? $end : $c_end;
if ($c_start > $c_end || $c_start > $size - 1 || $c_end >= $size) {