From 288188afa98cd0ff65b2c2bf529fba0bff15f634 Mon Sep 17 00:00:00 2001 From: Tom N Harris Date: Tue, 19 Jun 2012 23:42:00 -0400 Subject: HTTP headers are already parsed, there is no need for regexp --- inc/HTTPClient.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'inc/HTTPClient.php') diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php index ea9b42862..534ba220c 100644 --- a/inc/HTTPClient.php +++ b/inc/HTTPClient.php @@ -400,7 +400,8 @@ class HTTPClient { //read body (with chunked encoding if needed) $r_body = ''; - if(preg_match('/transfer\-(en)?coding:\s*chunked\r\n/i',$r_headers)){ + if((isset($this->resp_headers['transfer-encoding']) && $this->resp_headers['transfer-encoding'] == 'chunked') + || (isset($this->resp_headers['transfer-coding']) && $this->resp_headers['transfer-coding'] == 'chunked')){ do { $chunk_size = ''; do { -- cgit v1.2.3