зеркало из https://github.com/mozilla/gecko-dev.git
Bug 187441 URLs not HTML encoded in output
This commit is contained in:
Родитель
d89fca9ad1
Коммит
896cc0d1eb
|
@ -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 = "&";
|
||||
break;
|
||||
case '"':
|
||||
replacement = """;
|
||||
break;
|
||||
default:
|
||||
replacement = buf;
|
||||
buf[0] = str[j];
|
||||
|
|
Загрузка…
Ссылка в новой задаче