summaryrefslogtreecommitdiff
path: root/main/SAPI.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2015-02-05 20:09:49 -0800
committerStanislav Malyshev <stas@php.net>2015-02-05 20:10:09 -0800
commita1c28567c6aaa3d3978bf7a61c221d2230e5689a (patch)
tree29d754e36174bf634aeb082baefb58d4552d11b7 /main/SAPI.c
parent2c386b55f2f967e7846019c4dd4660e7c7807c0b (diff)
parent067340bbc8b323094cd4f63595f87f47b24f470f (diff)
downloadphp-git-a1c28567c6aaa3d3978bf7a61c221d2230e5689a.tar.gz
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: Update header handling to RFC 7230
Diffstat (limited to 'main/SAPI.c')
-rw-r--r--main/SAPI.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index 284164e4c0..550a4daf87 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -747,13 +747,8 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
/* new line/NUL character safety check */
int i;
for (i = 0; i < header_line_len; i++) {
- /* RFC 2616 allows new lines if followed by SP or HT */
- int illegal_break =
- (header_line[i+1] != ' ' && header_line[i+1] != '\t')
- && (
- header_line[i] == '\n'
- || (header_line[i] == '\r' && header_line[i+1] != '\n'));
- if (illegal_break) {
+ /* RFC 7230 ch. 3.2.4 deprecates folding support */
+ if (header_line[i] == '\n' || header_line[i] == '\r') {
efree(header_line);
sapi_module.sapi_error(E_WARNING, "Header may not contain "
"more than a single header, new line detected");