Commit Graph

182 Commits

Author SHA1 Message Date
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Niklas Keller
4b1dff6f43 Fix #70361: HTTP stream wrapper doesn't close keep-alive connections 2015-09-04 16:29:35 +02:00
Stanislav Malyshev
5776fceb16 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: (27 commits)
  fix non-standard C
  update NEWS
  5.4.41 next
  fix CVE num
  update NEWS
  Fix bug #69441 (Buffer Overflow when parsing tar/zip/phar in phar_set_inode)
  fix test
  fix type in fix for #69085
  fix memory leak & add test
  Fix tests
  fix CVE num
  Fix bug #69337 (php_stream_url_wrap_http_ex() type-confusion vulnerability)
  Fix test
  Additional fix for bug #69324
  More fixes for bug #69152
  Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions)
  Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar)
  Fixed bug #69316 (Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER)
  Fix bug #68486 and bug #69218 (segfault in apache2handler with apache 2.4)
  Fix bug #68819 (Fileinfo on specific file causes spurious OOM and/or segfault)
  ...

Conflicts:
	ext/standard/http_fopen_wrapper.c
2015-04-14 01:05:01 -07:00
Stanislav Malyshev
ba15e8dfd0 Merge branch 'PHP-5.4.40' into PHP-5.5.24
* PHP-5.4.40:
  fix memory leak & add test
  Fix tests
2015-04-12 23:49:16 -07:00
Stanislav Malyshev
45facd15fb fix memory leak & add test 2015-04-12 22:38:34 -07:00
Stanislav Malyshev
ed7d4977bb Merge branch 'PHP-5.4.40' into PHP-5.5.24
* PHP-5.4.40:
  Fix bug #69337 (php_stream_url_wrap_http_ex() type-confusion vulnerability)
  Fix test
2015-04-12 20:13:00 -07:00
Stanislav Malyshev
d82d68742c Fix bug #69337 (php_stream_url_wrap_http_ex() type-confusion vulnerability) 2015-04-12 01:30:33 -07:00
Daniel Lowrey
10bc5fd4c4 Fixed bug (#69195 Inconsistent stream crypto values across versions)
PHP 5.6.0 altered the semantics of the following constants:

- STREAM_CRYPTO_METHOD_SSLv23_CLIENT
- STREAM_CRYPTO_METHOD_SSLv23_SERVER
- STREAM_CRYPTO_METHOD_TLS_CLIENT
- STREAM_CRYPTO_METHOD_TLS_SERVER

Instead of representing the SSLv23_*() handshake methods the v23
constants were changed to allow only SSLv2 or SSLv3 connections.
Likewise, the TLS methods were modified from using only the TLSv1
handshake to allowing TLS1,1.1, and 1.2. This created a situation
in which users upgrading from previous versions faced a potential
security degradation if they did not update code to use different
constants. In the interest of compatibility across PHP versions
the original semantics have been restored with the following
caveat:

**IMPORTANT**

The SSLv23 client/server methods will no longer negotiate the use
of the insecure SSLv2 or SSLv3 protocols by default. Users wishing
to allow these protocols must explicitly add them to the method
bitmask via the appropriate flags.
2015-03-05 21:09:39 -07:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Xinchen Hui
73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Anatol Belski
236365a016 fix C89 compat 2014-07-14 20:27:59 +02:00
Daniel Lowrey
f3bf887e6d Bug #67609: TLS connections fail behind HTTP proxy 2014-07-12 10:51:44 -04:00
Adam Harvey
84f339546a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Follow 308 Permanent Redirect responses.
2014-06-12 18:17:18 -07:00
Adam Harvey
b51f82f260 Follow 308 Permanent Redirect responses.
Fixes bug #67430 (http:// wrapper doesn't follow 308 redirects).
2014-06-12 18:12:53 -07:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Xinchen Hui
c0d060f5c0 Bump year 2014-01-03 11:04:26 +08:00
Michael Wallner
d29a01de3f Merge branch 'PHP-5.5'
* PHP-5.5:
  Fixed bug #61548

Conflicts:
	ext/standard/http_fopen_wrapper.c
2013-10-01 11:11:48 +02:00
Michael Wallner
18b04b480e Fixed bug #61548 2013-10-01 11:07:55 +02:00
Adam Harvey
8983a38d51 Request non-keep-alive connections by default in HTTP 1.1 requests.
As noted in FR #65634, at present we don't send a Connection request header
when the protocol version is set to 1.1, which means that RFC-compliant Web
servers should respond with keep-alive connections. Since there's no way of
reusing the HTTP connection at present, this simply means that PHP will appear
to hang until the remote server hits its connection timeout, which may be quite
some time.

This commit sends a "Connection: close" header by default when HTTP 1.1 (or
later) is requested by the user via the context options. It can be overridden
by specifying a Connection header in the context options. It isn't possible to
disable sending of the Connection header, but given "Connection: keep-alive" is
the same as the default HTTP 1.1 behaviour, I don't see this as a significant
issue — users who want to opt in for that still can.

As a note, although I've removed an efree(protocol_version), this doesn't
result in a memory leak: protocol_version is freed in the out: block at the end
of the function anyway, and there are no returns between the removed efree()
and the later call. Yes, I ran the tests with valgrind to check that. ☺

Implements FR #65634 (HTTP wrapper is very slow with protocol_version 1.1).
2013-09-11 14:11:29 -07:00
Andrey Hristov
92d27ccb05 Constify streams API and a few other calls down the rabbit hole.
(`char *` to `const char *` for parameters and few return values)
In a few places int len moved to size_t len.
2013-07-30 12:49:36 +02:00
Sergey Akbarov
1d4fcdff9f Fix bug #64433: does not follow redirects for non-3xx response codes 2013-03-30 21:22:30 -07:00
Stanislav Malyshev
5382e156f9 Fix bug #62524, only follow redirects in file streams for 3xx HTTP statuses 2013-01-29 00:27:35 -08:00
Xinchen Hui
0a7395e009 Happy New Year 2013-01-01 16:28:54 +08:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Gustavo André dos Santos Lopes
f24f2b4df6 - Fixed bug #60570 (http wrapper leaks context resource if request fails/is
redirected).
2011-12-21 15:44:58 +00:00
Antony Dovgal
50f5c1e9b2 bail out if reading HTTP headers failed 2011-11-08 14:12:37 +00:00
Xinchen Hui
64fc565765 Avoiding strcpy, strcat, sprintf usage to make static analyzer happy 2011-08-09 12:16:58 +00:00
Ilia Alshanetsky
d2b11712ff Fixed bug #54137 (file_get_contents POST request sends additional line break). 2011-05-29 09:23:08 +00:00
Dmitry Stogov
aa5055ba0f Added ability to connect to HTTPS sites through proxy with basic authentication using stream_context/http/header/Proxy-Authorization 2011-01-28 10:33:47 +00:00
Ilia Alshanetsky
a6a4751a88 Fixed variable re-declaration 2011-01-12 13:21:27 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Gustavo André dos Santos Lopes
5c09767d4b - Fixed bug #53198 (changing INI setting "from" with ini_set did not have any
effect)
#Made "from" a proper INI setting and bound it to a global variable.
#Previously, it was simply read from the hash table with the parsed ini file
#by using cfg_get_string (I wonder why this mechanism still exists...)
2010-10-29 15:29:15 +00:00
Pierre Joye
4cda8a7797 -fix logic (and BC break) 2010-08-23 18:05:05 +00:00
Pierre Joye
a0e223b8ba - add follow_location support for http stream, enabled by default to keep BC. Allows one to ignore the location header, w/o having to ignore errors or other tricks, the location data is however still available (meta) 2010-08-23 16:54:57 +00:00
Pierre Joye
7bd81da0b5 - WS 2010-08-16 10:29:01 +00:00
Kalle Sommer Nielsen
dd8e59da8f Removed safe_mode
* Removed ini options, safe_mode*
 * Removed --enable-safe-mode --with-exec-dir configure options on Unix
 * Updated extensions, SAPI's and core
 * php_get_current_user() is now declared in main.c, thrus no need to include safe_mode.h anymore
2010-04-26 23:53:30 +00:00
Jani Taskinen
5952473b7a - Fixed bug #50832 (HTTP fopen wrapper does not support passwordless HTTP authentication) 2010-01-25 16:28:13 +00:00
Sebastian Bergmann
9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00
Ilia Alshanetsky
d56c1fdf14 Fixed bug #50451 (http wrapper breaks on 2048 char long headers)
# Improvement on the fix for bug #49851
2009-12-13 15:44:22 +00:00
Ilia Alshanetsky
47b3371122 Fixed bug #49851 (http wrapper breaks on 1024 char long headers). 2009-12-10 03:23:05 +00:00
Felipe Pena
f61a06350a - Switching to TSRMLS_FETCH version 2009-11-16 10:36:27 +00:00
Felipe Pena
5411bb32a8 - Fixed bug #49936 (crash with ftp stream in php_stream_context_get_option())
(patch by Pierrick)
2009-11-15 20:30:57 +00:00
Antony Dovgal
307a2259e9 fix memleak and possible segfault in HTTP fopen wrapper 2009-08-04 09:24:48 +00:00
Jani Taskinen
be6338014a - Fixed bug #43510 (stream_get_meta_data() does not return same mode as used in fopen) 2009-08-01 03:17:31 +00:00
Jani Taskinen
c0aab038ba Fixed bug #48929 (Double \r\n after HTTP headers when "header" context option is an array) 2009-07-20 10:54:37 +00:00
Arnaud Le Blanc
a5db3627e5 Fixed bug #38802 (max_redirects and ignore_errors)
(patch by datibbaw@php.net)
2009-05-16 20:34:48 +00:00
Greg Beaver
7aabee2ec6 MFH: fix potential free of NULL 2009-05-14 13:36:56 +00:00
Jani Taskinen
0b4875313a MFH: - Fixed Bug #45092header HTTP context option not being used (--with-curlwrappers) 2009-05-05 00:31:56 +00:00
Jani Taskinen
6611eb0b98 - Sync with HEAD 2009-05-05 00:16:21 +00:00
Dmitry Stogov
679c6298e3 - Added "dechunk" filter which can decode HTTP responces with chunked transfer-encoding. HTTP streams use this filter automatically in case "Transfer-Encoding: chunked" header presents in responce. It's possible to disable this behaviour using "http"=>array("auto_decode"=>0) in stream context
- Fixed bug #47021 (SoapClient stumbles over WSDL delivered with "Transfer-Encoding: chunked")
2009-04-16 10:16:27 +00:00