encode the name, it could contain XML entities
Like ", which would unquote the attribute value. Crazy but true.
1 files changed, 6 insertions(+), 4 deletions(-) | |||
---|---|---|---|
M | stagit.c | +6 | -4 |
1@@ -480,10 +480,12 @@ writeheader(FILE *fp, const char *title)
2 fputs(" - ", fp);
3 xmlencode(fp,
description, strlen(description));
4 fprintf(fp,
"</title>\n<link rel=\"icon\" type=\"image/png\"
href=\"%sfavicon.png\" />\n", relpath);
5- fprintf(fp, "<link rel=\"alternate\"
type=\"application/atom+xml\" title=\"%s Atom Feed\" href=\"%satom.xml\"
/>\n",
6- name, relpath);
7- fprintf(fp,
"<link rel=\"alternate\" type=\"application/atom+xml\" title=\"%s
Atom Feed (tags)\" href=\"%stags.xml\" />\n",
8- name, relpath);
9+
fputs("<link rel=\"alternate\" type=\"application/atom+xml\"
title=\"", fp);
10+ xmlencode(fp, name,
strlen(name));
11+ fprintf(fp, "
Atom Feed\" href=\"%satom.xml\" />\n", relpath);
12+
fputs("<link rel=\"alternate\" type=\"application/atom+xml\"
title=\"", fp);
13+ xmlencode(fp, name,
strlen(name));
14+ fprintf(fp, "
Atom Feed (tags)\" href=\"%stags.xml\" />\n", relpath);
15 fprintf(fp, "<link
rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\"
/>\n", relpath);
16
fputs("</head>\n<body>\n<table><tr><td>",
fp);
17 fprintf(fp,
"<a href=\"../%s\"><img src=\"%slogo.png\"
alt=\"\" width=\"32\" height=\"32\"
/></a>",