php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37906 headers_list output appears incomplete
Submitted: 2006-06-24 17:04 UTC Modified: 2006-06-24 18:26 UTC
From: mike at brenden dot com Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 5.1.1 OS: linux
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mike at brenden dot com
New email:
PHP Version: OS:

 

 [2006-06-24 17:04 UTC] mike at brenden dot com
Description:
------------
startphp:

header('X-x: yes');
$ho=apache_response_headers();
echo '<p>HEADERS FROM MG</p>';
print_r($ho);
var_dump(headers_list());

:endphp

output from headers_list() shows only numeric indices and header-item name; it does not also show the header-item value (example: [0] element containts only 'X-x' but does not also contain colon, space and 'yes')

meanwhile, apache_response_headers() works as described.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-24 17:11 UTC] mike@php.net
What's your SAPI?

Post a tiny but complete reproduce script with output please!
 [2006-06-24 18:00 UTC] mike at brenden dot com
< ?php

  header('X-x: yes');
  
  $hdrs=apache_request_headers();
  echo '<p><b>apache_request_headers in</b></p>';
  print_r($hdrs);

  $ho=apache_response_headers();
  echo '<p><b>apache_response_headers out</b></p>';
  print_r($ho);
  
  echo '<p><b>headers_list out</b></p>';
  var_dump(headers_list());

  echo '<p><b>sapi='. php_sapi_name(). '</b></p>';
  
? >




apache_request_headers in

Array ( [Host] => pics.brenden.com [User-Agent] => Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4 [Accept] => text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 [Accept-Language] => en-us,en;q=0.5 [Accept-Encoding] => gzip,deflate [Accept-Charset] => ISO-8859-1,utf-8;q=0.7,*;q=0.7 [Keep-Alive] => 300 [Connection] => keep-alive [Cookie] => picss=d55dd48565ebbc0d0fdb74d527413a34 )

apache_response_headers out

Array ( [X-x] => yes )

headers_list out

array(2) { [0]=> string(3) "X-x" [1]=> string(12) "Content-type" }

sapi=apache2handler
 [2006-06-24 18:02 UTC] mike at brenden dot com
this lives at http://pics.brenden.com/test.bdc
 [2006-06-24 18:08 UTC] mike@php.net
This has been fixed in PHP-5.1.3

You ain't really using PHP-5.1.4 are you?

 [2006-06-24 18:26 UTC] mike at brenden dot com
ah, you know, thaaat might explain much weirdness.  thank you for looking and for sanity (insanity?) check.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Dec 02 11:03:35 2021 UTC