Skip to content

Commit

Permalink
RemoteFilesystem: fix result length check (composer#10656)
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubinix authored and emahorvat52 committed Jan 18, 2023
1 parent 09ef02b commit fcf921e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Composer/Util/RemoteFilesystem.php
Expand Up @@ -526,7 +526,7 @@ protected function getRemoteContents(string $originUrl, string $fileUrl, $contex
} catch (\Throwable $e) {
}

if ($maxFileSize !== null && Platform::strlen($result) >= $maxFileSize) {
if ($result !== false && $maxFileSize !== null && Platform::strlen($result) >= $maxFileSize) {
throw new MaxFileSizeExceededException('Maximum allowed download size reached. Downloaded ' . Platform::strlen($result) . ' of allowed ' . $maxFileSize . ' bytes');
}

Expand Down

0 comments on commit fcf921e

Please sign in to comment.