mirror of
https://github.com/rkd77/elinks.git
synced 2024-07-01 02:05:33 +00:00
[gopher] Also escape text in search and in links. Refs #125
This commit is contained in:
parent
1c005dc9c2
commit
0f10ae6ddb
|
@ -353,24 +353,29 @@ static void
|
||||||
add_gopher_link(struct string *buffer, const char *text,
|
add_gopher_link(struct string *buffer, const char *text,
|
||||||
const char *addr)
|
const char *addr)
|
||||||
{
|
{
|
||||||
add_format_to_string(buffer, "<a href=\"%s\">%s</a>",
|
add_to_string(buffer, "<a href=\"");
|
||||||
addr, text);
|
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
|
static void
|
||||||
add_gopher_search_field(struct string *buffer, const char *text,
|
add_gopher_search_field(struct string *buffer, const char *text,
|
||||||
const char *addr)
|
const char *addr)
|
||||||
{
|
{
|
||||||
add_format_to_string(buffer,
|
add_to_string(buffer, "<form action=\"");
|
||||||
"<form action=\"%s\">"
|
add_html_to_string(buffer, addr, strlen(addr));
|
||||||
|
add_to_string(buffer, "\">"
|
||||||
"<table>"
|
"<table>"
|
||||||
"<td> </td>"
|
"<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 maxlength=\"256\" name=\"search\" value=\"\"></td>"
|
||||||
"<td><input type=submit value=\"Search\"></td>"
|
"<td><input type=submit value=\"Search\"></td>"
|
||||||
"</table>"
|
"</table>"
|
||||||
"</form>",
|
"</form>");
|
||||||
addr, text);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user