#29099 [Opn]: file_get_contents returns corrupted results with remote files
| From: | curt@php.net | Date: | Sun, 11 Jul 2004 21:19:52 +0000 |
| Subject: | #29099 [Opn]: file_get_contents returns corrupted results with remote files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-62068@lists.php.net to get a copy of this message | ||
ID: 29099
Updated by: curt@php.net
Reported By: mj@php.net
Status: Open
Bug Type: Filesystem function related
Operating System: Linux
PHP Version: 5CVS-2004-07-11 (dev)
New Comment:
it seems this broke between June 18th and July 8, possibly related to
php_stream_copy_to_mem().
Previous Comments:
------------------------------------------------------------------------
[2004-07-11 20:48:15] mj@php.net
Description:
------------
When using file_get_contents() on remote files, the result differs from
the (correct) result using the Curl functions.
Reproduce code:
---------------
$ch = curl_init("http://www.php.net/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$str1 = curl_exec($ch);
curl_close($ch);
$str2 = file_get_contents("http://www.php.net/");
if ($str1 != $str2) {
echo "Both results differ.\n";
} else {
echo "Both results are the same.\n";
}
Expected result:
----------------
Output "Both results are the same."
Actual result:
--------------
Output "Both results differ."
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29099&edit=1