tivo: Fix title and description escaping.
This commit is contained in:
parent
e165dbf7a9
commit
0845c2193b
@ -123,6 +123,7 @@ tivo_unescape_tag(char *tag)
|
|||||||
modifyString(tag, "&lt;", "<", 1);
|
modifyString(tag, "&lt;", "<", 1);
|
||||||
modifyString(tag, "&amp;gt;", ">", 1);
|
modifyString(tag, "&amp;gt;", ">", 1);
|
||||||
modifyString(tag, "&gt;", ">", 1);
|
modifyString(tag, "&gt;", ">", 1);
|
||||||
|
modifyString(tag, "&quot;", """, 1);
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,13 +186,8 @@ callback(void *args, int argc, char **argv, char **azColName)
|
|||||||
episode = strstr(title, " - ");
|
episode = strstr(title, " - ");
|
||||||
if( episode )
|
if( episode )
|
||||||
{
|
{
|
||||||
strcatf(str, "<Title>%.*s</Title>"
|
strcatf(str, "<EpisodeTitle>%s</EpisodeTitle>", episode+3);
|
||||||
"<EpisodeTitle>%s</EpisodeTitle>",
|
*episode = '\0';
|
||||||
(int)(episode-title), title, episode+3);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
strcatf(str, "<Title>%s</Title>", title);
|
|
||||||
}
|
}
|
||||||
if( date )
|
if( date )
|
||||||
{
|
{
|
||||||
@ -202,13 +198,13 @@ callback(void *args, int argc, char **argv, char **azColName)
|
|||||||
strcatf(str, "<CaptureDate>0x%X</CaptureDate>", (unsigned int)mktime(&tm));
|
strcatf(str, "<CaptureDate>0x%X</CaptureDate>", (unsigned int)mktime(&tm));
|
||||||
}
|
}
|
||||||
if( comment )
|
if( comment )
|
||||||
strcatf(str, "<Description>%s</Description>", comment);
|
strcatf(str, "<Description>%s</Description>", tivo_unescape_tag(comment));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
strcatf(str, "<Title>%s</Title>", tivo_unescape_tag(title));
|
strcatf(str, "<Title>%s</Title>", title);
|
||||||
if( artist ) {
|
if( artist ) {
|
||||||
strcatf(str, "<ArtistName>%s</ArtistName>", tivo_unescape_tag(artist));
|
strcatf(str, "<ArtistName>%s</ArtistName>", tivo_unescape_tag(artist));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user