Bug 187441 URLs not HTML encoded in output

This commit is contained in:
timeless%mozdev.org 2003-01-02 17:07:34 +00:00
Родитель 2fe35577da
Коммит c7352dda2d
2 изменённых файлов: 11 добавлений и 3 удалений

Просмотреть файл

@ -80,14 +80,16 @@ reportHTMLAttributeValue(void *a, HTML *html, Input *input)
{
URL *url;
View *view;
char *urlstring;
view = a;
if (html->currentAttributeIsURL)
{
url = urlRelative(html->base, html->currentAttribute->value);
fprintf(view->out, "<a href=%s%s>", me,
url ? (char*) url->url : "");
urlstring = escapeHTML(url ? (char*) url->url : "");
fprintf(view->out, "<a href=\"%s%s\">", me, urlstring);
free(urlstring);
urlFree(url);
}
viewHTMLAttributeValue(view, input);
@ -151,12 +153,15 @@ void
reportHTTPHeaderValue(void *a, Input *input, unsigned char *url)
{
View *view;
char *urlstring;
view = a;
if (url)
{
fprintf(view->out, "<a href=%s%s>", me, url);
urlstring = escapeHTML(url);
fprintf(view->out, "<a href=\"%s%s\">", me, urlstring);
free(urlstring);
}
viewHTTPHeaderValue(view, input);
if (url)

Просмотреть файл

@ -899,6 +899,9 @@ escapeHTML(unsigned char *str)
case '&':
replacement = "&amp;";
break;
case '"':
replacement = "&quot;";
break;
default:
replacement = buf;
buf[0] = str[j];