Changeset 0f64ca7 for lib


Ignore:
Timestamp:
2010-04-25T12:56:20Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
be28fe7
Parents:
f1b7711
Message:

Make http_encode() RFC3986-compliant. (Escape everything except alphanumeric
characters plus [-_~.].)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/misc.c

    rf1b7711 r0f64ca7  
    306306        for( i = j = 0; t[i]; i ++, j ++ )
    307307        {
    308                 /* if( t[i] <= ' ' || ((unsigned char *)t)[i] >= 128 || t[i] == '%' ) */
    309                 if( !isalnum( t[i] ) )
     308                if( !isalnum( t[i] ) && !strchr( "._-~", t[i] ) )
    310309                {
    311310                        sprintf( s + j, "%%%02X", ((unsigned char*)t)[i] );
Note: See TracChangeset for help on using the changeset viewer.