php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #55684 Example #1 header_register_callback
Submitted: 2011-09-13 14:13 UTC Modified: 2011-09-13 15:09 UTC
From: gwarnants at gmail dot com Assigned: rquadling (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
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: gwarnants at gmail dot com
New email:
PHP Version: OS:

 

 [2011-09-13 14:13 UTC] gwarnants at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.header-register-callback%23Examples
---

Example #1 is testing the availability of header "X-Powered" before removing "X-Powered-By" header, which is not completely safe.

Expected result:
----------------
   if (strpos($header, 'X-Powered-By') === 0) {
     header_remove('X-Powered-By');
   }

Actual result:
--------------
   if (strpos($header, 'X-Powered') !== false) {
     header_remove('X-Powered-By');
   }

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-13 15:09 UTC] rquadling@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: rquadling
 [2011-09-13 15:09 UTC] rquadling@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Revision: http://svn.php.net/viewvc/?view=revision&revision=316649
Log: Rename file. Fix bug #55679
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 27 16:01:27 2024 UTC