@@ -213,7 +213,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
213
213
char header_line [HTTP_HEADER_BLOCK_SIZE ];
214
214
215
215
/* get response header */
216
- while (php_stream_gets (stream , header_line , HTTP_HEADER_BLOCK_SIZE - 1 ) != NULL ) {
216
+ while (php_stream_gets (stream , header_line , HTTP_HEADER_BLOCK_SIZE - 1 ) != NULL ) {
217
217
if (header_line [0 ] == '\n' ||
218
218
header_line [0 ] == '\r' ||
219
219
header_line [0 ] == '\0' ) {
@@ -233,7 +233,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
233
233
}
234
234
}
235
235
236
- if (stream == NULL )
236
+ if (stream == NULL )
237
237
goto out ;
238
238
239
239
/* avoid buffering issues while reading header */
@@ -309,7 +309,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
309
309
}
310
310
311
311
/* query string */
312
- if (resource -> query ) {
312
+ if (resource -> query ) {
313
313
strlcat (scratch , "?" , scratch_len );
314
314
strlcat (scratch , resource -> query , scratch_len );
315
315
}
@@ -442,15 +442,15 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
442
442
}
443
443
444
444
/* if the user has configured who they are, send a From: line */
445
- if (((have_header & HTTP_HEADER_FROM ) == 0 ) && cfg_get_string ("from" , & tmp ) == SUCCESS ) {
445
+ if (((have_header & HTTP_HEADER_FROM ) == 0 ) && cfg_get_string ("from" , & tmp ) == SUCCESS ) {
446
446
if (snprintf (scratch , scratch_len , "From: %s\r\n" , tmp ) > 0 )
447
447
php_stream_write (stream , scratch , strlen (scratch ));
448
448
}
449
449
450
450
/* Send Host: header so name-based virtual hosts work */
451
451
if ((have_header & HTTP_HEADER_HOST ) == 0 ) {
452
452
if ((use_ssl && resource -> port != 443 && resource -> port != 0 ) ||
453
- (!use_ssl && resource -> port != 80 && resource -> port != 0 )) {
453
+ (!use_ssl && resource -> port != 80 && resource -> port != 0 )) {
454
454
if (snprintf (scratch , scratch_len , "Host: %s:%i\r\n" , resource -> host , resource -> port ) > 0 )
455
455
php_stream_write (stream , scratch , strlen (scratch ));
456
456
} else {
@@ -685,7 +685,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
685
685
php_stream_close (stream );
686
686
stream = NULL ;
687
687
688
- if (location [0 ] != '\0' ) {
688
+ if (location [0 ] != '\0' ) {
689
689
690
690
char new_path [HTTP_HEADER_BLOCK_SIZE ];
691
691
char loc_path [HTTP_HEADER_BLOCK_SIZE ];
@@ -697,7 +697,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
697
697
strncasecmp (location , "ftps://" , sizeof ("ftps://" )- 1 )))
698
698
{
699
699
if (* location != '/' ) {
700
- if (* (location + 1 ) != '\0' && resource -> path ) {
700
+ if (* (location + 1 ) != '\0' && resource -> path ) {
701
701
char * s = strrchr (resource -> path , '/' );
702
702
if (!s ) {
703
703
s = resource -> path ;
@@ -736,20 +736,20 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
736
736
goto out ;
737
737
}
738
738
739
- #define CHECK_FOR_CNTRL_CHARS (val ) { \
740
- if (val) { \
741
- unsigned char *s, *e; \
742
- int l; \
743
- l = php_url_decode(val, strlen(val)); \
744
- s = (unsigned char*)val; e = s + l; \
745
- while (s < e) { \
746
- if (iscntrl(*s)) { \
747
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect URL! %s", new_path); \
748
- goto out; \
749
- } \
750
- s++; \
751
- } \
752
- } \
739
+ #define CHECK_FOR_CNTRL_CHARS (val ) { \
740
+ if (val) { \
741
+ unsigned char *s, *e; \
742
+ int l; \
743
+ l = php_url_decode(val, strlen(val)); \
744
+ s = (unsigned char*)val; e = s + l; \
745
+ while (s < e) { \
746
+ if (iscntrl(*s)) { \
747
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect URL! %s", new_path); \
748
+ goto out; \
749
+ } \
750
+ s++; \
751
+ } \
752
+ } \
753
753
}
754
754
/* check for control characters in login, password & path */
755
755
if (strncasecmp (new_path , "http://" , sizeof ("http://" ) - 1 ) || strncasecmp (new_path , "https://" , sizeof ("https://" ) - 1 )) {
@@ -839,7 +839,7 @@ static php_stream_wrapper_ops http_stream_wops = {
839
839
NULL /* rmdir */
840
840
};
841
841
842
- PHPAPI php_stream_wrapper php_stream_http_wrapper = {
842
+ PHPAPI php_stream_wrapper php_stream_http_wrapper = {
843
843
& http_stream_wops ,
844
844
NULL ,
845
845
1 /* is_url */
0 commit comments