Re: problem with header() and php trunk
| From: | Carsten Wiedmann | Date: | Fri, 25 Feb 2011 10:36:12 +0000 |
| Subject: | Re: problem with header() and php trunk | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-51535@lists.php.net to get a copy of this message | ||
Am 24.02.2011 23:56, schrieb Carsten Wiedmann:
Oh, this only happens with trunk, but not with e.g 5.3.5. But just see the difference:OK, this bug was introduced in r301263. It's removing +1 char while cutting LWS at the end of a header line. <<<PATCH Index: SAPI.c =================================================================== --- SAPI.c (Revision 308566) +++ SAPI.c (Arbeitskopie) @@ -680,7 +680,7 @@ do { header_line_len--; } while(header_line_len && isspace(header_line[header_line_len-1])); - header_line[--header_line_len]='\0'; + header_line[header_line_len]='\0'; } if (op == SAPI_HEADER_DELETE) { PATCH; <<<TESTPHPT --TEST-- header() function - LWS at end of field-value --GET-- --FILE-- <?php header('x-headertest: foo '); var_dump(headers_list()); ?> --EXPECTREGEX-- .*string\(17\) \"x-headertest: foo\".* TESTPHPT; BTW: PHP is removing LWS at the end of the field-value, but why is it not replacing LWS between the field-name: and field-value with one SP? Regards, Carsten