php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30028 stream_get_contents() doesn't respect the $maxlength
Submitted: 2004-09-08 18:25 UTC Modified: 2004-09-09 12:54 UTC
From: nlopess@php.net Assigned:
Status: Closed Package: Network related
PHP Version: 5CVS-2004-09-08 (dev) OS: n/a
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nlopess@php.net
New email:
PHP Version: OS:

 

 [2004-09-08 18:25 UTC] nlopess@php.net
Description:
------------
It seems that stream_get_contents() isn't respecting the second paramether, limit.
I think this only happen for http wrappers.

Reproduce code:
---------------
<?
$fp = fopen('http://www.php.net/', 'r');

echo strlen(stream_get_contents($fp, 50));

fclose($fp);

?>

Expected result:
----------------
50

Actual result:
--------------
30094

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-09 12:54 UTC] nlopess@php.net
Fixed by Sara.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 04:01:33 2025 UTC