diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2017-11-17 23:22:12 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2017-11-17 23:22:12 +0100 |
commit | a8db62086efe256c120443862c55e305d3ceb359 (patch) | |
tree | 60a972173c506a5b424470bc42fcc6b61b9d755d /ext/standard/http_fopen_wrapper.c | |
parent | 80d6eb6806a6317c99a2608e28f42869c834d0e7 (diff) | |
parent | 31d9287d2b4bc30a5fc032a94cb3cec214aa715e (diff) | |
download | php-git-a8db62086efe256c120443862c55e305d3ceb359.tar.gz |
Merge branch 'PHP-7.2'
Diffstat (limited to 'ext/standard/http_fopen_wrapper.c')
-rw-r--r-- | ext/standard/http_fopen_wrapper.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 4156fcbfab..ae0e23ff1f 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -781,6 +781,10 @@ finish: && (*http_header_value == ' ' || *http_header_value == '\t')) { http_header_value++; } + } else { + /* There is no colon. Set the value to the end of the header line, which is + * effectively an empty string. */ + http_header_value = e; } if (!strncasecmp(http_header_line, "Location:", sizeof("Location:")-1)) { @@ -797,11 +801,11 @@ finish: strlcpy(location, http_header_value, sizeof(location)); } else if (!strncasecmp(http_header_line, "Content-Type:", sizeof("Content-Type:")-1)) { php_stream_notify_info(context, PHP_STREAM_NOTIFY_MIME_TYPE_IS, http_header_value, 0); - } else if (!strncasecmp(http_header_line, "Content-Length:", sizeof("Content-Length")-1)) { + } else if (!strncasecmp(http_header_line, "Content-Length:", sizeof("Content-Length:")-1)) { file_size = atoi(http_header_value); php_stream_notify_file_size(context, file_size, http_header_line, 0); } else if ( - !strncasecmp(http_header_line, "Transfer-Encoding:", sizeof("Transfer-Encoding")-1) + !strncasecmp(http_header_line, "Transfer-Encoding:", sizeof("Transfer-Encoding:")-1) && !strncasecmp(http_header_value, "Chunked", sizeof("Chunked")-1) ) { |