1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-03 13:03:50 +00:00

#934: remove invalid tracker addresses

This commit is contained in:
Charles Kerr 2008-05-21 20:56:12 +00:00
parent 958e70543e
commit 4398943230

View file

@ -954,6 +954,20 @@ tr_sha1_to_hex( char * out, const uint8_t * sha1 )
int
tr_httpIsValidURL( const char * url )
{
const char * c;
static const char * rfc2396_valid_chars =
"abcdefghijklmnopqrstuvwxyz" /* lowalpha */
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" /* upalpha */
"0123456789" /* digit */
"-_.!~*'()" /* mark */
";/?:@&=+$," /* reserved */
"<>#%<\"" /* delims */
"{}|\\^[]`"; /* unwise */
for( c=url; c && *c; ++c )
if( !strchr( rfc2396_valid_chars, *c ) )
return FALSE;
return !tr_httpParseURL( url, -1, NULL, NULL, NULL );
}