From b9d5f19b729f650436c50670acaea9fcfd6faf19 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 25 Jul 2009 14:30:32 +0200 Subject: more robustness in gzip decoding in HTTPClient FS#1718 Ignore-this: f55bde6815d68e6e79117cdc5e4d1f77 darcs-hash:20090725123032-7ad00-9f3e6289fd73f385020334545d38e779dc104dd6.gz --- inc/HTTPClient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/HTTPClient.php') 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; } -- cgit v1.2.3