Fixed file size check in FileService::download()

This commit is contained in:
Marcin Kurczewski 2014-09-16 18:09:14 +02:00
parent c8f0cb6e56
commit c155cc3e5c

View file

@ -112,7 +112,7 @@ class FileService
while (!feof($srcHandle))
{
$buffer = fread($srcHandle, 4 * 1024);
if ($maxBytes !== null and ftell($dstHandle) > $maxBytes)
if ($maxBytes !== null and strlen($result) > $maxBytes)
{
throw new \Exception(
'File is too big (maximum size: %s)',