From c155cc3e5c18ea4aa776c5beffcfcaaef1959b1c Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Tue, 16 Sep 2014 18:09:14 +0200 Subject: [PATCH] Fixed file size check in FileService::download() --- src/Services/FileService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/FileService.php b/src/Services/FileService.php index d0c3dbbc..8a0eb3ba 100644 --- a/src/Services/FileService.php +++ b/src/Services/FileService.php @@ -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)',