mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Added max_redirects context option that specifies how many HTTP redirects
to follow.
This commit is contained in:
parent
b874c94d81
commit
3ae10919c4
2
NEWS
2
NEWS
@ -101,6 +101,8 @@ PHP NEWS
|
||||
- Added zlib stream filter support. (Sara)
|
||||
- Added bz2 stream filter support. (Sara)
|
||||
- Added HTTP/1.1 and chunked encoding support to http:// wrapper. (Sara)
|
||||
- Added max_redirects context option that specifies how many HTTP
|
||||
redirects to follow. (Ilia)
|
||||
- Added support of parameter=>value arrays to
|
||||
xsl_xsltprocessor_set_parameter(). (Tony)
|
||||
- Fixed extension initialization to respect dependancies between extensions.
|
||||
|
@ -104,7 +104,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
|
||||
int protocol_version_len = 3; /* Default: "1.0" */
|
||||
|
||||
if (redirect_max < 1) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Circular redirect, aborting.");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Redirection limit reached, aborting.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -182,6 +182,12 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
|
||||
|
||||
php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0);
|
||||
|
||||
if (header_init && context && php_stream_context_get_option(context, "http", "max_redirects", &tmpzval) == SUCCESS) {
|
||||
SEPARATE_ZVAL(tmpzval);
|
||||
convert_to_long_ex(tmpzval);
|
||||
redirect_max = Z_LVAL_PP(tmpzval);
|
||||
}
|
||||
|
||||
if (context &&
|
||||
php_stream_context_get_option(context, "http", "method", &tmpzval) == SUCCESS) {
|
||||
if (Z_TYPE_PP(tmpzval) == IS_STRING && Z_STRLEN_PP(tmpzval) > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user