#30028 [NEW]: stream_get_contents() doesn't respect the $maxlength

From: Date: Wed, 08 Sep 2004 16:25:58 +0000
Subject: #30028 [NEW]: stream_get_contents() doesn't respect the $maxlength
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-65933@lists.php.net to get a copy of this message
From: nlopess@php.net Operating system: n/a PHP version: 5CVS-2004-09-08 (dev) PHP Bug Type: Network related Bug description: stream_get_contents() doesn't respect the $maxlength 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 -- Edit bug report at http://bugs.php.net/?id=30028&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30028&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30028&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30028&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30028&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30028&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30028&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30028&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30028&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30028&r=support Expected behavior: http://bugs.php.net/fix.php?id=30028&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30028&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30028&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30028&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30028&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30028&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30028&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30028&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30028&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30028&r=mysqlcfg

« previous php.bugs (#65933) next »