Fix fseek filesize.

This commit is contained in:
Lars Jung 2015-05-21 00:33:54 +02:00
parent efc4623a0b
commit 570431e39c

View file

@ -17,8 +17,9 @@ class Filesize {
fseek($handle, 0, SEEK_SET);
while ($step > 1) {
if (fseek($handle, $step, SEEK_CUR) === 0) {
$size += $step;
fseek($handle, $step, SEEK_CUR);
if (fgetc($handle) !== false) {
$size += $step + 1;
} else {
fseek($handle, -$step, SEEK_CUR);
$step = intval($step / 2, 10);