* Fix some issues with ampersand escaping.

* Improve image date/camera metadata handling by not storing a date if none exists.
* Add preliminary TiVo video serving support.
This commit is contained in:
Justin Maggard
2009-04-16 19:20:16 +00:00
parent 0303f15fa4
commit 223df2111b
7 changed files with 362 additions and 211 deletions

18
utils.c
View File

@ -94,12 +94,28 @@ modifyString(char * string, const char * before, const char * after, short like)
return string;
}
char *
escape_tag(const char *tag)
{
char *esc_tag = NULL;
if( strchr(tag, '&') || strchr(tag, '<') || strchr(tag, '>') )
{
esc_tag = strdup(tag);
esc_tag = modifyString(esc_tag, "&", "&amp;amp;", 0);
esc_tag = modifyString(esc_tag, "<", "&amp;lt;", 0);
esc_tag = modifyString(esc_tag, ">", "&amp;gt;", 0);
}
return esc_tag;
}
void
strip_ext(char * name)
{
char * period;
period = rindex(name, '.');
period = strrchr(name, '.');
if( period )
*period = '\0';
}