Recommitting filesize checks in smartReadFile
This commit is contained in:
parent
d5477dfb5b
commit
7eef9d941e
|
@ -158,7 +158,15 @@ class ApiController extends Zend_Controller_Action
|
|||
throw new FileDoesNotExistException("Requested file does not exist!");
|
||||
}
|
||||
|
||||
$size= filesize($location);
|
||||
// If we're passing in a Stored File object, it's faster
|
||||
// to use getFileSize() and pass in the result
|
||||
if (!$size || $size <= 0) {
|
||||
$size= filesize($location);
|
||||
}
|
||||
|
||||
if ($size <= 0) {
|
||||
throw new Exception("Invalid file size returned for file at $location");
|
||||
}
|
||||
|
||||
$fm = @fopen($location, 'rb');
|
||||
if (!$fm) {
|
||||
|
|
Loading…
Reference in New Issue