Changeset 5891


Ignore:
Timestamp:
May 21, 2008, 8:56:12 PM (14 years ago)
Author:
charles
Message:

#934: remove invalid tracker addresses

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r5860 r5891  
    955955tr_httpIsValidURL( const char * url )
    956956{
     957    const char * c;
     958    static const char * rfc2396_valid_chars =
     959        "abcdefghijklmnopqrstuvwxyz" /* lowalpha */
     960        "ABCDEFGHIJKLMNOPQRSTUVWXYZ" /* upalpha */
     961        "0123456789"                 /* digit */
     962        "-_.!~*'()"                  /* mark */
     963        ";/?:@&=+$,"                 /* reserved */
     964        "<>#%<\""                    /* delims */
     965        "{}|\\^[]`";                 /* unwise */
     966
     967    for( c=url; c && *c; ++c )
     968        if( !strchr( rfc2396_valid_chars, *c ) )
     969            return FALSE;
     970
    957971    return !tr_httpParseURL( url, -1, NULL, NULL, NULL );
    958972}
Note: See TracChangeset for help on using the changeset viewer.