diff --git a/core/Http.php b/core/Http.php index 694799294d4e748b4c01c80b6267dba80af4d8a6..33f5b308c8aec1ae12de8a23d71ef3fc09a68538 100644 --- a/core/Http.php +++ b/core/Http.php @@ -566,7 +566,7 @@ class Piwik_Http @fclose($file); $fileSize = filesize($destinationPath); - if((($contentLength > MINIMUM_CONTENT_LENGTH_TO_ENABLE_CHECK) && ($fileLength != $contentLength)) + if((($contentLength > 0) && ($fileLength != $contentLength)) || ($fileSize != $fileLength)) { throw new Exception('File size error: '.$destinationPath.'; expected '.$contentLength.' bytes; received '.$fileLength.' bytes; saved '.$fileSize.' bytes to file');