Browse Source

Fix special character escape

tags/1.0
Timo Röhling 12 years ago
parent
commit
5d26960180
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      postsrsd.c

+ 2
- 2
postsrsd.c View File

@@ -125,10 +125,10 @@ static char* url_encode (char* buf, size_t len, const char *input)
125 125
   char *output = buf;
126 126
   if (!input || !output || len == 0) return NULL;
127 127
   while (*input && --len) {
128
-    if (isspace(*input)) {
128
+    if (!isascii(*input) || !isgraph(*input) || *input == '%') {
129 129
       if (len <= 2) break;
130 130
       *output++ = '%';
131
-      char2hex(*input, output);
131
+      char2hex(*input++, output);
132 132
       output += 2; len -= 2;
133 133
     } else {
134 134
       *output++ = *input++;

Loading…
Cancel
Save