mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-13 03:45:22 +01:00
[Http] Making sure that the fseek operation succeeded on the stream before calculating the MD5 hash
This commit is contained in:
parent
0bc9e1fb80
commit
e324a44675
@ -199,11 +199,10 @@ class EntityBody extends Stream
|
||||
*/
|
||||
public function getContentMd5($rawOutput = false, $base64Encode = false)
|
||||
{
|
||||
if (!$this->isSeekable()) {
|
||||
if (!$this->seek(0)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->seek(0);
|
||||
$ctx = hash_init('md5');
|
||||
while ($data = $this->read(1024)) {
|
||||
hash_update($ctx, $data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user