1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

[gopher] Also escape text in search and in links. Refs #125

This commit is contained in:
Witold Filipczyk 2021-08-28 12:32:01 +02:00
parent 1c005dc9c2
commit 0f10ae6ddb

View File

@ -353,24 +353,29 @@ static void
add_gopher_link(struct string *buffer, const char *text,
const char *addr)
{
add_format_to_string(buffer, "<a href=\"%s\">%s</a>",
addr, text);
add_to_string(buffer, "<a href=\"");
add_html_to_string(buffer, addr, strlen(addr));
add_to_string(buffer, "\">");
add_html_to_string(buffer, text, strlen(text));
add_to_string(buffer, "</a>");
}
static void
add_gopher_search_field(struct string *buffer, const char *text,
const char *addr)
{
add_format_to_string(buffer,
"<form action=\"%s\">"
add_to_string(buffer, "<form action=\"");
add_html_to_string(buffer, addr, strlen(addr));
add_to_string(buffer, "\">"
"<table>"
"<td> </td>"
"<td>%s:</td>"
"<td>");
add_html_to_string(buffer, text, strlen(text));
add_to_string(buffer,":</td>"
"<td><input maxlength=\"256\" name=\"search\" value=\"\"></td>"
"<td><input type=submit value=\"Search\"></td>"
"</table>"
"</form>",
addr, text);
"</form>");
}
static void