#37146 [Opn->Bgs]: file_get_contents fails with some URLs

From: Date: Thu, 20 Apr 2006 11:29:21 +0000
Subject: #37146 [Opn->Bgs]: file_get_contents fails with some URLs
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-96037@lists.php.net to get a copy of this message
 ID:               37146
 Updated by:       johannes@php.net
 Reported By:      mx at tut dot by
-Status:           Open
+Status:           Bogus
 Bug Type:         Streams related
 Operating System: Debian Linux
 PHP Version:      5.1.2
 New Comment:

The second URL is an 404


Previous Comments:
------------------------------------------------------------------------

[2006-04-20 11:27:26] 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


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37146&edit=1


Thread (2 messages)

« previous php.bugs (#96037) next »