Home » HTTP » HTTP_Request » Bug #9374
Incorrect work HTTP_Request::_readChunked()
Details
| Submitted | 2006-11-18 08:43 UTC |
|---|---|
| From | balancer at balancer dot ru |
| Status | Bogus |
| Package | HTTP_Request |
| PHP Version | 5.1.6 |
| OS | Gentoo Linux |
| Roadmaps | (Not assigned) |
Comments
[2006-11-18 08:43 UTC] balancer at balancer dot ru
Description:
------------
Function _readChunked() using function strlen() for get chunked string size. It's incorrect for unicode system.
Test script:
---------------
<xmp><?php
require_once "HTTP/Request.php";
$req = &new HTTP_Request("http://control.renter.ru/ipstat/");
$req->addHeader("Accept-Charset", 'UTF-8');
$req->addHeader("Accept-Encoding", 'none');
$resp = $req->sendRequest();
if (!PEAR::isError($resp))
$resp = $req->getResponseBody();
else
$resp = $resp->getMessage();
echo "resp=".$resp;
?></xmp>
Expected result:
----------------
Full html page.
Actual result:
--------------
Truncated HTML page.
If change HTTP/Requset.php:1176
from
$this->_chunkLength -= strlen($data);
to
$this->_chunkLength -= strlen($data) - 1;
then page downloaded full.
Need to change from strlen($data) to function returns really byte-length (not char-length).