This commit is contained in:
Pierre Joye 2010-08-23 17:16:17 +00:00
parent a6c5363f05
commit b9d73bb910

View file

@ -742,20 +742,20 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
goto out; goto out;
} }
#define CHECK_FOR_CNTRL_CHARS(val) { \ #define CHECK_FOR_CNTRL_CHARS(val) { \
if (val) { \ if (val) { \
unsigned char *s, *e; \ unsigned char *s, *e; \
int l; \ int l; \
l = php_url_decode(val, strlen(val)); \ l = php_url_decode(val, strlen(val)); \
s = (unsigned char*)val; e = s + l; \ s = (unsigned char*)val; e = s + l; \
while (s < e) { \ while (s < e) { \
if (iscntrl(*s)) { \ if (iscntrl(*s)) { \
php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect URL! %s", new_path); \ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect URL! %s", new_path); \
goto out; \ goto out; \
} \ } \
s++; \ s++; \
} \ } \
} \ } \
} }
/* check for control characters in login, password & path */ /* check for control characters in login, password & path */
if (strncasecmp(new_path, "http://", sizeof("http://") - 1) || strncasecmp(new_path, "https://", sizeof("https://") - 1)) { if (strncasecmp(new_path, "http://", sizeof("http://") - 1) || strncasecmp(new_path, "https://", sizeof("https://") - 1)) {