summaryrefslogtreecommitdiff
path: root/main/SAPI.c
diff options
context:
space:
mode:
authorRui Hirokawa <hirokawa@php.net>2012-01-14 07:41:01 +0000
committerRui Hirokawa <hirokawa@php.net>2012-01-14 07:41:01 +0000
commit61088ce7296f2a3b4b53e60bdf413455b870664d (patch)
treed1bd1ef7711aff8e849d397823df61294e0410a1 /main/SAPI.c
parentf115235a6e9db4a91456a5e5475e858de7c06ef8 (diff)
downloadphp-git-61088ce7296f2a3b4b53e60bdf413455b870664d.tar.gz
MFH: fixed bug #60227: header() cannot detect the multi-line header with CR.
Diffstat (limited to 'main/SAPI.c')
-rw-r--r--main/SAPI.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index 92e3d0874d..154ab6bf29 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -592,7 +592,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
} else {
/* new line safety check */
char *s = header_line, *e = header_line + header_line_len, *p;
- while (s < e && (p = memchr(s, '\n', (e - s)))) {
+ while (s < e && ((p = memchr(s, '\n', (e - s))) || (p = memchr(s, '\r', (e - s))))) {
if (*(p + 1) == ' ' || *(p + 1) == '\t') {
s = p + 1;
continue;