Skip to content

Commit

Permalink
Truncate range requests that go past the end of the file
Browse files Browse the repository at this point in the history
If the range end was too high, the function would try (and fail) to return the full range asked for.

Fixes Issue happyworm#7.
  • Loading branch information
countingpine committed Mar 20, 2023
1 parent 79a7ab1 commit 5ac067a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion smartReadFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function smartReadFile($location, $filename, $mimeType = 'application/octet-stre
$begin = intval($matches[1]);
if (!empty($matches[2]))
{
$end = intval($matches[2]);
$end = min($end, intval($matches[2]));
}
}
}
Expand Down

0 comments on commit 5ac067a

Please sign in to comment.