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:
Justin Maggard 2015-08-03 00:20:45 -07:00
parent f85f5afe65
commit 8f7e760747
2 changed files with 5 additions and 5 deletions

View File

@ -827,8 +827,6 @@ ProcessHttpQuery_upnphttp(struct upnphttp * h)
for(i = 0; i<15 && *p && *p != '\r'; i++) for(i = 0; i<15 && *p && *p != '\r'; i++)
HttpVer[i] = *(p++); HttpVer[i] = *(p++);
HttpVer[i] = '\0'; 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 */ /* set the interface here initially, in case there is no Host header */
for(i = 0; i<n_lan_addr; i++) for(i = 0; i<n_lan_addr; i++)
@ -879,7 +877,7 @@ ProcessHttpQuery_upnphttp(struct upnphttp * h)
h->state = 100; 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) if(strcmp("POST", HttpCommand) == 0)
{ {
h->req_command = EPost; h->req_command = EPost;

View File

@ -194,14 +194,16 @@ unescape_tag(const char *tag, int force_alloc)
{ {
char *esc_tag = NULL; char *esc_tag = NULL;
if( strstr(tag, "&amp;") || strstr(tag, "&lt;") || strstr(tag, "&gt;") if (strchr(tag, '&') &&
|| strstr(tag, "&quot;") ) (strstr(tag, "&amp;") || strstr(tag, "&lt;") || strstr(tag, "&gt;") ||
strstr(tag, "&quot;") || strstr(tag, "&apos;")))
{ {
esc_tag = strdup(tag); esc_tag = strdup(tag);
esc_tag = modifyString(esc_tag, "&amp;", "&", 1); esc_tag = modifyString(esc_tag, "&amp;", "&", 1);
esc_tag = modifyString(esc_tag, "&lt;", "<", 1); esc_tag = modifyString(esc_tag, "&lt;", "<", 1);
esc_tag = modifyString(esc_tag, "&gt;", ">", 1); esc_tag = modifyString(esc_tag, "&gt;", ">", 1);
esc_tag = modifyString(esc_tag, "&quot;", "\"", 1); esc_tag = modifyString(esc_tag, "&quot;", "\"", 1);
esc_tag = modifyString(esc_tag, "&apos;", "'", 1);
} }
else if( force_alloc ) else if( force_alloc )
esc_tag = strdup(tag); esc_tag = strdup(tag);