diff options
author | Andreas Gohr <andi@splitbrain.org> | 2009-07-25 14:30:32 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2009-07-25 14:30:32 +0200 |
commit | b9d5f19b729f650436c50670acaea9fcfd6faf19 (patch) | |
tree | ce530463395cab7edbb0dd25744c30b5b8ff8bd9 | |
parent | 9df39f145412a47b64ed00e58d49195eb529acf8 (diff) | |
download | rpg-b9d5f19b729f650436c50670acaea9fcfd6faf19.tar.gz rpg-b9d5f19b729f650436c50670acaea9fcfd6faf19.tar.bz2 |
more robustness in gzip decoding in HTTPClient FS#1718
Ignore-this: f55bde6815d68e6e79117cdc5e4d1f77
darcs-hash:20090725123032-7ad00-9f3e6289fd73f385020334545d38e779dc104dd6.gz
-rw-r--r-- | inc/HTTPClient.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php index e769b0c93..59046ceb5 100644 --- a/inc/HTTPClient.php +++ b/inc/HTTPClient.php @@ -415,8 +415,8 @@ class HTTPClient { fclose($socket); // decode gzip if needed - if($this->resp_headers['content-encoding'] == 'gzip'){ - $this->resp_body = gzinflate(substr($r_body, 10)); + if($this->resp_headers['content-encoding'] == 'gzip' && strlen($r_body) > 10 && substr($r_body,0,3)=="\x1f\x8b\x08"){ + $this->resp_body = @gzinflate(substr($r_body, 10)); }else{ $this->resp_body = $r_body; } |