#47759 [Opn->Bgs]: file_get_contents does not decode chunk encoded data

From: Date: Tue, 24 Mar 2009 23:50:25 +0000
Subject: #47759 [Opn->Bgs]: file_get_contents does not decode chunk encoded data
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-135080@lists.php.net to get a copy of this message
ID: 47759 Updated by: iliaa@php.net Reported By: marques at displague dot com -Status: Open +Status: Bogus Bug Type: HTTP related PHP Version: 5.2.9 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php . Previous Comments: ------------------------------------------------------------------------ [2009-03-24 13:39:48] marques at displague dot com Description: ------------ file_get_contents() does not decode HTTP content sent with "Transfer-Encoding: chunked". This is probably also true for fopen() and other HTTP stream handlers in PHP. RFC2616 section 3.6.1: All HTTP/1.1 applications MUST be able to receive and decode the "chunked" transfer-coding, and MUST ignore chunk-extension extensions they do not understand. Reproduce code: --------------- echo file_get_contents('somechunkedurl.html'); Expected result: ---------------- This is the data in the first chunk and this is the second one Actual result: -------------- 23 This is the data in the first chunk 1A and this is the second one 0 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47759&edit=1

« previous php.bugs (#135080) next »