Re: header_remove() issues (overly aggressive?)
| From: | Hannes Magnusson | Date: | Tue, 23 Jun 2009 20:22:08 +0000 |
| Subject: | Re: header_remove() issues (overly aggressive?) | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-44448@lists.php.net to get a copy of this message | ||
2009/6/23 Gwynne Raskind <gwynne@darkrainfall.org>:
> On Jun 23, 2009, at 3:49 PM, Johannes Schlüter wrote:
>>>
>>> While documenting header_remove() I was experimenting a little bit..
>>>
>>> If an "empty" argument is passed to the function (empty string, null,
>>> false,..) the function doesn't do anything, as it checks for
>>> ZEND_NUM_ARGS() rather then the length of string.. thats a doc issue
>>> or bug?
>>
>> I'd say it's ok, "remove the header with the name ''."
>> That's what it
>> does.
>
> A header named '' isn't valid in HTTP 1.0 or 1.1 anyway; this is an error
> case IMO.
Also, shouldn't we return false/true when we [can't] remove the named
header? Or a int, with the number of removed items?
>>> Second, it removes even the X-Powered-By header, is that expected?
>
> Useful for people who don't have control over their expose_php setting...
>
>>> Third, it removes session and even cookie headers..
>>
>>> Is that really expected? Just add a big fat warning on the doc page?
>>
>> It removes all. Should be ok, too, removing the session cookie might
>> even be considered a "good" feature by some.
>
> Including me! ;)
Documented as a 'caution'.
-Hannes