* Properly escape double quotes.

This commit is contained in:
Justin Maggard
2012-02-13 23:07:40 +00:00
parent 996b373f83
commit 774d8f9f6e
2 changed files with 6 additions and 24 deletions

View File

@ -182,12 +182,13 @@ escape_tag(const char *tag, int force_alloc)
{
char *esc_tag = NULL;
if( strchr(tag, '&') || strchr(tag, '<') || strchr(tag, '>') )
if( strchr(tag, '&') || 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);
esc_tag = modifyString(esc_tag, "\"", "&amp;quot;", 0);
}
else if( force_alloc )
esc_tag = strdup(tag);