Bug #9374 [NEW]: Incorrect work HTTP_Request::_readChunked()
| From: | balancer at balancer dot ru | Date: | Sat, 18 Nov 2006 08:43:36 +0000 |
| Subject: | Bug #9374 [NEW]: Incorrect work HTTP_Request::_readChunked() | ||
| Groups: | php.pear.webmaster | ||
| Request: | Send a blank email to pear-webmaster+get-5427@lists.php.net to get a copy of this message | ||
From: balancer at balancer dot ru
Operating system: Gentoo Linux
Package version:
PHP version: 5.1.6
Package: Bug System
Bug Type: Bug
Bug description: Incorrect work HTTP_Request::_readChunked()
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).
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=9374&edit=1
--