diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-01-10 15:36:49 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-01-10 15:36:49 +0100 |
commit | dd8d4c5243eea91dd3b0709ae76abdd3743e99bc (patch) | |
tree | 6260da3a7609b90f58128953f45be98227515abc | |
parent | 4fe4be2723eba3b7f3640396a1c8fa80b39fe2ab (diff) |
http_encode() now just escapes everything except [A-Za-z0-9]. Should fix #83.
-rw-r--r-- | util.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -35,6 +35,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <ctype.h> #include <glib.h> #include <time.h> @@ -376,7 +377,8 @@ void http_encode( char *s ) for( i = j = 0; t[i]; i ++, j ++ ) { - if( t[i] <= ' ' || ((unsigned char *)t)[i] >= 128 || t[i] == '%' ) + /* if( t[i] <= ' ' || ((unsigned char *)t)[i] >= 128 || t[i] == '%' ) */ + if( !isalnum( t[i] ) ) { sprintf( s + j, "%%%02X", ((unsigned char*)t)[i] ); j += 2; |