#37146 [NEW]: file_get_contents fails with some URLs

From: Date: Thu, 20 Apr 2006 11:27:26 +0000
Subject: #37146 [NEW]: file_get_contents fails with some URLs
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-96036@lists.php.net to get a copy of this message
From:             mx at tut dot by
Operating system: Debian Linux
PHP version:      5.1.2
PHP Bug Type:     Streams related
Bug description:  file_get_contents fails with some URLs

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 bug report at http://bugs.php.net/?id=37146&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37146&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=37146&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37146&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37146&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=37146&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37146&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37146&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37146&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37146&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37146&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=37146&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=37146&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37146&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37146&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37146&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37146&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37146&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37146&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37146&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37146&r=mysqlcfg


Thread (2 messages)

« previous php.bugs (#96036) next »