php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37146 file_get_contents fails with some URLs
Submitted: 2006-04-20 11:27 UTC Modified: 2006-04-20 11:29 UTC
From: mx at tut dot by Assigned:
Status: Not a bug Package: Streams related
PHP Version: 5.1.2 OS: Debian 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: mx at tut dot by
New email:
PHP Version: OS:

 

 [2006-04-20 11:27 UTC] mx at tut dot by
Description:
------------
the function file_get_contents() doesn't work with some URLs, I assume the problem is with URL parsing, when URL has HTTP request parameters, like "http://www.example.com/foo.php?a=b"


Reproduce code:
---------------
<?

$content = file_get_contents("http://us.news3.yimg.com/us.i2.yimg.com/p/nm/20060419/2006_04_19t164700_450x285_us_space_shuttle.jpg?x=130&amp;y=82&amp;sig=l23WoOTKgoZalMdt.DZN2w--");

print $content;

?>

Expected result:
----------------
GIF image file dump

Actual result:
--------------
PHP Warning:  file_get_contents("http://us.news3.yimg.com/us.i2.yimg.com/p/ap/20060410/capt.la10904102108.moon_mission_la109.jpg?x=130&amp;y=90&amp;sig=F0rDybhZKx.XPw7xzIyKQg--"): failed to open stream

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-20 11:29 UTC] johannes@php.net
The second URL is an 404
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC