]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
fix htsbuf_append_and_escape_url() - don't escape more allowed characters, fixes...
authorJaroslav Kysela <perex@perex.cz>
Fri, 3 Nov 2017 19:13:39 +0000 (20:13 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 3 Nov 2017 19:14:55 +0000 (20:14 +0100)
src/htsbuf.c

index c9193e92f287e3fff631078141daf806dbc93bce..545eacdbedc34333493ea2ee047f6b267038cef4 100644 (file)
@@ -406,13 +406,24 @@ htsbuf_append_and_escape_url(htsbuf_queue_t *hq, const char *s)
     char buf[4];
     C = *c++;
     
+    /* RFC 3986, section 3.4 */
     if((C >= '0' && C <= '9') ||
        (C >= 'a' && C <= 'z') ||
        (C >= 'A' && C <= 'Z') ||
-       C == '_' ||
-       C == '~' ||
-       C == '.' ||
-       C == '-') {
+       C == '/'  ||
+       C == ':'  ||
+       C == '@'  ||
+       C == '-'  ||
+       C == '.'  ||
+       C == '~'  ||
+       C == '!'  ||
+       C == '$'  ||
+       C == '\'' ||
+       C == '('  ||
+       C == ')'  ||
+       C == '*'  ||
+       C == ','  ||
+       C == ';') {
       esc = NULL;
     } else {
       static const char hexchars[16] = "0123456789ABCDEF";