php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43749 function get_headers() fails on a particular URL
Submitted: 2008-01-04 12:02 UTC Modified: 2008-01-13 14:49 UTC
Votes:4
Avg. Score:5.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:1 (25.0%)
From: jeremy dot amiot at gmail dot com Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 5.2.5 OS: Linux 2.4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jeremy dot amiot at gmail dot com
New email:
PHP Version: OS:

 

 [2008-01-04 12:02 UTC] jeremy dot amiot at gmail dot com
Description:
------------
Hello,

get_headers() fails with this king of URL : http://www.radioblogclub.com/listen.php?u=..wLzRmb192cv8mZulmLzRmcvNWZy9Gb1NmcvBnch12b0FmL3d3d/Wolf%2520Eyes%2520-%2520The%2520driller.rbs&k=657ecb3231ac0b275497d4d6f00b61a1

it returns me :
Warning:  get_headers(http://www.radioblogclub.com/listen.php?u=..wLzRmb192cv8mZulmLzRmcvNWZy9Gb1NmcvBnch12b0FmL3d3d/Wolf%2520Eyes%2520-%2520The%2520driller.rbs&k=657ecb3231ac0b275497d4d6f00b61a1) [function.get-headers]: failed to open stream: HTTP request failed!  in ********* on line 5.

But when you type this URL in your browser, it works well, it redirects you to a file. (header(location))


Reproduce code:
---------------
<?php
$url = 'http://www.radioblogclub.com/listen.php?u=..wLzRmb192cv8mZulmLzRmcvNWZy9Gb1NmcvBnch12b0FmL3d3d/Wolf%2520Eyes%2520-%2520The%2520driller.rbs&k=657ecb3231ac0b275497d4d6f00b61a1';
print_r(get_headers($url));
?>


Expected result:
----------------
Fetches all the headers sent by the server in response to my HTTP request

Actual result:
--------------
Warning:  get_headers(http://www.radioblogclub.com/listen.php?u=..wLzRmb192cv8mZulmLzRmcvNWZy9Gb1NmcvBnch12b0FmL3d3d/Wolf%2520Eyes%2520-%2520The%2520driller.rbs&k=657ecb3231ac0b275497d4d6f00b61a1) [function.get-headers]: failed to open stream: HTTP request failed!  in ********* on line 5.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-13 14:49 UTC] bjori@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The returned Location header incorrectly contains spaces.
You can get the response header (before the failure) from the $http_response_header array.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 11:01:30 2024 UTC