php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29099 file_get_contents returns corrupted results with remote files
Submitted: 2004-07-11 20:48 UTC Modified: 2004-07-13 01:01 UTC
From: mj@php.net Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 5CVS-2004-07-11 (dev) OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mj@php.net
New email:
PHP Version: OS:

 

 [2004-07-11 20:48 UTC] 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."

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-11 23:19 UTC] curt@php.net
it seems this broke between June 18th and July 8, possibly related to php_stream_copy_to_mem().

 [2004-07-13 01:01 UTC] curt@php.net
Fixed in cvs
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 02 15:01:31 2024 UTC