diff --git a/upnphttp.c b/upnphttp.c index 6905f17..418cde4 100644 --- a/upnphttp.c +++ b/upnphttp.c @@ -827,8 +827,6 @@ ProcessHttpQuery_upnphttp(struct upnphttp * h) for(i = 0; i<15 && *p && *p != '\r'; i++) HttpVer[i] = *(p++); HttpVer[i] = '\0'; - /*DPRINTF(E_INFO, L_HTTP, "HTTP REQUEST : %s %s (%s)\n", - HttpCommand, HttpUrl, HttpVer);*/ /* set the interface here initially, in case there is no Host header */ for(i = 0; istate = 100; } - DPRINTF(E_DEBUG, L_HTTP, "HTTP REQUEST[%d]: %.*s\n", h->state, h->req_buflen, h->req_buf); + DPRINTF(E_DEBUG, L_HTTP, "HTTP REQUEST: %.*s\n", h->req_buflen, h->req_buf); if(strcmp("POST", HttpCommand) == 0) { h->req_command = EPost; diff --git a/utils.c b/utils.c index d728136..5a233dc 100644 --- a/utils.c +++ b/utils.c @@ -194,14 +194,16 @@ unescape_tag(const char *tag, int force_alloc) { char *esc_tag = NULL; - if( strstr(tag, "&") || strstr(tag, "<") || strstr(tag, ">") - || strstr(tag, """) ) + if (strchr(tag, '&') && + (strstr(tag, "&") || strstr(tag, "<") || strstr(tag, ">") || + strstr(tag, """) || strstr(tag, "'"))) { esc_tag = strdup(tag); esc_tag = modifyString(esc_tag, "&", "&", 1); esc_tag = modifyString(esc_tag, "<", "<", 1); esc_tag = modifyString(esc_tag, ">", ">", 1); esc_tag = modifyString(esc_tag, """, "\"", 1); + esc_tag = modifyString(esc_tag, "'", "'", 1); } else if( force_alloc ) esc_tag = strdup(tag);