From: Ilia Alshanetsky Date: Sun, 16 Apr 2006 16:55:25 +0000 (+0000) Subject: MFB51: Fixed bug #37045 (Fixed check for special chars for http redirects). X-Git-Tag: RELEASE_1_3~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=53ab6c0920922cf1eccee9a876a6c5ed859830b6;p=php MFB51: Fixed bug #37045 (Fixed check for special chars for http redirects). --- diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 81bc0be112..6232c16df9 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -691,10 +691,11 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, } \ } \ /* check for control characters in login, password & path */ - CHECK_FOR_CNTRL_CHARS(resource->user) - CHECK_FOR_CNTRL_CHARS(resource->pass) - CHECK_FOR_CNTRL_CHARS(resource->path) - + if (strncasecmp(newpath, "http://", sizeof("http://") - 1) || strncasecmp(newpath, "https://", sizeof("https://") - 1) { + CHECK_FOR_CNTRL_CHARS(resource->user) + CHECK_FOR_CNTRL_CHARS(resource->pass) + CHECK_FOR_CNTRL_CHARS(resource->path) + } stream = php_stream_url_wrap_http_ex(wrapper, new_path, mode, options, opened_path, context, --redirect_max, 0 STREAMS_CC TSRMLS_CC); } else { php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP request failed! %s", tmp_line);