utils: Unescape "'" in .nfo files.
Kodi escapes apostrophes when exporting its database to .nfo files. Fixes: Bug #271 (Handle &apos in .nfo files)
This commit is contained in:
parent
f85f5afe65
commit
8f7e760747
@ -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; i<n_lan_addr; i++)
|
||||
@ -879,7 +877,7 @@ ProcessHttpQuery_upnphttp(struct upnphttp * h)
|
||||
h->state = 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;
|
||||
|
6
utils.c
6
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user