]> granicus.if.org Git - php/commitdiff
Merge branch 'master' into phpng
authorDmitry Stogov <dmitry@zend.com>
Mon, 14 Jul 2014 07:44:53 +0000 (11:44 +0400)
committerDmitry Stogov <dmitry@zend.com>
Mon, 14 Jul 2014 07:44:53 +0000 (11:44 +0400)
* master: (40 commits)
  Bug #67609: TLS connections fail behind HTTP proxy
  Updated NEWS for #67594
  Updated NEWS for #67594
  Fix #67594 - invisible colon should be stripped off header name
  Updated NEWS for 34407
  Updated NEWS for 34407
  Updated NEWS for 34407
  Fix for bug #34407 - ucwords and title case
  fixed broken merged code
  Fixed a bug that cannot access custom request header stored in apache_request_headers() though array index.
  fixed broken merged code
  Fixed a bug that cannot access custom request header stored in apache_request_headers() though array index.
  Fixed a bug that cannot access custom request header stored in apache_request_headers() though array index.
  Fixed a bug that cannot access custom request header stored in apache_request_headers() though array index.
  Test output relies on expose_php being on
  1.2 is a problematic float to print out Lower the default display precision for this test
  The test output is dependent on expose_php ini
  fix makefile in phpize mode
  fixe output_as_table() when no ext was enabled
  fix end of stream exception when generating makefile
  ...

Conflicts:
ext/standard/http_fopen_wrapper.c
ext/standard/string.c
sapi/cli/php_cli_server.c

1  2 
ext/standard/basic_functions.c
ext/standard/http_fopen_wrapper.c
ext/standard/string.c
sapi/cli/php_cli_server.c
sapi/litespeed/lsapi_main.c

Simple merge
index f7d6fc45008becab0514f9c70712a7aa9bd195e6,3eecd7bdaecee87e606dbf2b2697f3b450f4bb96..eb6cebf5345090677ad492bb33ca917bbbba4aec
@@@ -120,7 -120,7 +120,7 @@@ php_stream *php_stream_url_wrap_http_ex
        char *scratch = NULL;
        char *tmp = NULL;
        char *ua_str = NULL;
-       zval *ua_zval = NULL, *tmpzval = NULL;
 -      zval **ua_zval = NULL, **tmpzval = NULL, *ssl_proxy_peer_name = NULL;
++      zval *ua_zval = NULL, *tmpzval = NULL, ssl_proxy_peer_name;
        int scratch_len = 0;
        int body = 0;
        char location[HTTP_HEADER_BLOCK_SIZE];
        efree(transport_string);
  
        if (stream && use_proxy && use_ssl) {
 -              if (!context || php_stream_context_get_option(context, "ssl", "peer_name", &tmpzval) == FAILURE) {
 -                      MAKE_STD_ZVAL(ssl_proxy_peer_name);
 -                      ZVAL_STRING(ssl_proxy_peer_name, resource->host, 1);
 -                      php_stream_context_set_option(stream->context, "ssl", "peer_name", ssl_proxy_peer_name);
+               /* Set peer_name or name verification will try to use the proxy server name */
++              if (!context || (tmpzval = php_stream_context_get_option(context, "ssl", "peer_name")) == NULL) {
++                      ZVAL_STRING(&ssl_proxy_peer_name, resource->host);
++                      php_stream_context_set_option(stream->context, "ssl", "peer_name", &ssl_proxy_peer_name);
+               }
                smart_str header = {0};
  
                smart_str_appendl(&header, "CONNECT ", sizeof("CONNECT ")-1);
index ec9b8a02a25d22ee3af2ffc6b03e1185d12c1981,ab8280346fd0e2666f87ce19ad69a7b52d03c125..5f4f360ca661eaec7747b9ee3371476b8df95af8
@@@ -2748,25 -2738,22 +2748,30 @@@ PHP_FUNCTION(lcfirst
     Uppercase the first character of every word in a string */
  PHP_FUNCTION(ucwords)
  {
-       char *str;
+       char *str, *delims = " \t\r\n\f\v";
        register char *r, *r_end;
-       int str_len;
+       int str_len, delims_len = 6;
+       char mask[256];
  
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
 +#ifndef FAST_ZPP
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &str, &str_len, &delims, &delims_len) == FAILURE) {
                return;
        }
-       ZEND_PARSE_PARAMETERS_START(1, 1)
 +#else
++      ZEND_PARSE_PARAMETERS_START(1, 2)
 +              Z_PARAM_STRING(str, str_len)
++              Z_PARAM_OPTIONAL
++              Z_PARAM_STRING(delims, delims_len)
 +      ZEND_PARSE_PARAMETERS_END();
 +#endif
  
        if (!str_len) {
                RETURN_EMPTY_STRING();
        }
  
 -      ZVAL_STRINGL(return_value, str, str_len, 1);
+       php_charmask((unsigned char *)delims, delims_len, mask TSRMLS_CC);
 +      ZVAL_STRINGL(return_value, str, str_len);
        r = Z_STRVAL_P(return_value);
  
        *r = toupper((unsigned char) *r);
index 4b16e97a567ba93ffcc35138bf491212a77806e9,4cd251ed428004681556f29dd3580c1063845eba..8fe195f6d7a0c694c62395dfde02f14b7b6cf80f
@@@ -1615,10 -1621,14 +1615,13 @@@ static int php_cli_server_client_read_r
                return 1;
        }
        {
-               char *header_name = zend_str_tolower_dup(client->current_header_name, client->current_header_name_len);
-               zend_hash_str_add_ptr(&client->request.headers, header_name, client->current_header_name_len, value);
-               zend_hash_str_add_ptr(&client->request.headers_original_case, client->current_header_name, client->current_header_name_len, value);
-               efree(header_name);
+               /* strip off the colon */
 -              char *orig_header_name = estrndup(client->current_header_name, client->current_header_name_len);
++              zend_string *orig_header_name = STR_INIT(client->current_header_name, client->current_header_name_len, 1);
+               char *lc_header_name = zend_str_tolower_dup(client->current_header_name, client->current_header_name_len);
 -
 -              zend_hash_add(&client->request.headers, lc_header_name, client->current_header_name_len + 1, &value, sizeof(char *), NULL);
 -              zend_hash_add(&client->request.headers_original_case, orig_header_name, client->current_header_name_len + 1, &value, sizeof(char *), NULL);
++              zend_hash_str_add_ptr(&client->request.headers, lc_header_name, client->current_header_name_len, value);
++              zend_hash_add_ptr(&client->request.headers_original_case, orig_header_name, value);
+               efree(lc_header_name);
 -              efree(orig_header_name);
++              STR_RELEASE(orig_header_name);
        }
  
        if (client->current_header_name_allocated) {
Simple merge