php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46545 get_headers() has problems when get redirected from http to https
Submitted: 2008-11-11 15:59 UTC Modified: 2008-11-11 20:38 UTC
From: matthias at pc-intern dot com Assigned:
Status: Closed Package: HTTP related
PHP Version: 5.2CVS-2008-11-11 (CVS) OS: Debian Etch, PHP 5.2.0-8+etch11
Private report: No CVE-ID: None
 [2008-11-11 15:59 UTC] matthias at pc-intern dot com
Description:
------------
If you check an HTTP URL with get_headers() function which redirects to another HTTPS URL, NULL will returned. If the redirect-HTTPS-URL is checked directly, there is no error. extension=php_openssl.dll is enabled.

Reproduce code:
---------------
works: get_headers('http://foo.com');
works: get_headers('http://foo.com?redirect=http://foo2.com');
don't work: get_headers('http://foo.com?redirect=https://foo2.com');

Expected result:
----------------
array (HEADERS);
There should be no problem when a HTTP URL redirectes to an HTTPS URL

Actual result:
--------------
NULL

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-11 18:01 UTC] matthias at pc-intern dot com
btw: works, too: get_headers('https://foo.com');
 [2008-11-11 18:45 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2008-11-11 20:38 UTC] matthias at pc-intern dot com
I updated and now it works, thx!
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Nov 17 15:01:41 2019 UTC