Skip to content

Commit

Permalink
Merge r1022 and r1023 into 1.1 (blame rmccue if these are broken).
Browse files Browse the repository at this point in the history
  • Loading branch information
gsnedders committed Dec 19, 2008
1 parent b0906eb commit ca6e1d4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions simplepie.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8382,7 +8382,7 @@ class SimplePie_gzdecode
$this->flags = ord($this->compressed_data[3]);

// FLG bits above (1 << 4) are reserved
if ($flg > 0x1F)
if ($this->flags > 0x1F)
{
return false;
}
Expand Down Expand Up @@ -8514,17 +8514,17 @@ class SimplePie_gzdecode
}

// Check CRC of data
$crc = current(unpack('N', substr($this->compressed_data, $this->position, 4)));
$crc = current(unpack('V', substr($this->compressed_data, $this->position, 4)));
$this->position += 4;
if (extension_loaded('hash') && hexdec(hash('crc32b', $this->data)) !== $crc)
/*if (extension_loaded('hash') && sprintf('%u', current(unpack('V', hash('crc32b', $this->data)))) !== sprintf('%u', $crc))
{
return false;
}
}*/

// Check ISIZE of data
$isize = current(unpack('N', substr($this->compressed_data, $this->position, 4)));
$isize = current(unpack('V', substr($this->compressed_data, $this->position, 4)));
$this->position += 4;
if (strlen($this->data) & 0xFFFFFFFF !== $isize)
if (sprintf('%u', strlen($this->data) & 0xFFFFFFFF) !== sprintf('%u', $isize))
{
return false;
}
Expand Down

0 comments on commit ca6e1d4

Please sign in to comment.