Commit:    d29a01de3f35a33c539a805e28a22a6514924a19
Author:    Michael Wallner <m...@php.net>         Tue, 1 Oct 2013 11:11:48 +0200
Parents:   66cd9ef04cf20ead3db58f0bb387bb2070dbc591 
ad139d9a00d9de206c7aae4f85eff08eff2c429e
Branches:  master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=d29a01de3f35a33c539a805e28a22a6514924a19

Log:
Merge branch 'PHP-5.5'

* PHP-5.5:
  Fixed bug #61548

Conflicts:
        ext/standard/http_fopen_wrapper.c

Bugs:
https://bugs.php.net/61548

Changed paths:
  MM  ext/standard/http_fopen_wrapper.c


Diff:
diff --cc ext/standard/http_fopen_wrapper.c
index 8762fa4,4605e74..f5184ce
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@@ -85,8 -84,31 +85,33 @@@
  #define HTTP_WRAPPER_HEADER_INIT    1
  #define HTTP_WRAPPER_REDIRECTED     2
  
- php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, const 
char *path, const char *mode, int options,
-                                                                               
char **opened_path, php_stream_context *context, int redirect_max, int flags 
STREAMS_DC TSRMLS_DC) /* {{{ */
+ static inline void strip_header(char *header_bag, char *lc_header_bag,
+               const char *lc_header_name)
+ {
+       char *lc_header_start = strstr(lc_header_bag, lc_header_name);
+       char *header_start = header_bag + (lc_header_start - lc_header_bag);
+ 
+       if (lc_header_start
+       && (lc_header_start == lc_header_bag || *(lc_header_start-1) == '\n')
+       ) {
+               char *lc_eol = strchr(lc_header_start, '\n');
+               char *eol = header_start + (lc_eol - lc_header_start);
+ 
+               if (lc_eol) {
+                       size_t eollen = strlen(lc_eol);
+ 
+                       memmove(lc_header_start, lc_eol+1, eollen);
+                       memmove(header_start, eol+1, eollen);
+               } else {
+                       *lc_header_start = '\0';
+                       *header_start = '\0';
+               }
+       }
+ }
+ 
 -php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char 
*path, char *mode, int options, char **opened_path, php_stream_context 
*context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */
++php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, 
++              const char *path, const char *mode, int options, char 
**opened_path, 
++              php_stream_context *context, int redirect_max, int flags 
STREAMS_DC TSRMLS_DC) /* {{{ */
  {
        php_stream *stream = NULL;
        php_url *resource = NULL;


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to