php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73882 Patch for php_stream_url_wrap_http_ex to support multiple spaces
Submitted: 2017-01-06 15:51 UTC Modified: 2017-01-08 10:56 UTC
From: laurentconstantin at free dot fr Assigned: nikic (profile)
Status: Closed Package: HTTP related
PHP Version: 5.6.29 OS:
Private report: No CVE-ID: None
 [2017-01-06 15:51 UTC] laurentconstantin at free dot fr
Description:
------------
Hello,

The function php_stream_url_wrap_http_ex() in file ext/standard/http_fopen_wrapper.c
checks the presence of the "Transfer-Encoding: chunked" HTTP header to detect if
the filter has to be used.

However, the HTTP RFC allows multiple spaces after the ':'.

This patch adds the supports of this case.

This patch also updates the Location, Content-Type and Content-Length processing
which suffers the same bug. I've created two generic functions easier to use.

Thank you.



Patches

patch.txt (last revision 2017-01-06 15:55 UTC by laurentconstantin at free dot fr)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-07 21:10 UTC] nikic@php.net
-Assigned To: +Assigned To: nikic
 [2017-01-08 10:56 UTC] nikic@php.net
-Status: Assigned +Status: Closed
 [2017-01-08 10:56 UTC] nikic@php.net
I've merged PR https://github.com/php/php-src/pull/1902 yesterday, which is a fix for the same issue, which has been hanging around in the queue for some months. As the PR is older and a bit more complete (it also removes trailing whitespace, which the spec also allows), I went with it. But in any case, thanks for providing a patch :)
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Oct 19 12:01:27 2019 UTC