X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/69f705cf5727cc1f099f6cd6af759f66bfd9a343..fe1bb0e765883fa4149fba12daee81b6ae070de3:/html.c
diff --git a/html.c b/html.c
index 1305910..8f6e4f6 100644
--- a/html.c
+++ b/html.c
@@ -138,7 +138,7 @@ void html_attr(const char *txt)
const char *t = txt;
while(t && *t){
int c = *t;
- if (c=='<' || c=='>' || c=='\'' || c=='\"') {
+ if (c=='<' || c=='>' || c=='\'' || c=='\"' || c=='&') {
html_raw(txt, t - txt);
if (c=='>')
html(">");
@@ -148,6 +148,8 @@ void html_attr(const char *txt)
html("'");
else if (c=='"')
html(""");
+ else if (c=='&')
+ html("&");
txt = t+1;
}
t++;
@@ -160,11 +162,11 @@ void html_url_path(const char *txt)
{
const char *t = txt;
while(t && *t){
- int c = *t;
+ unsigned char c = *t;
const char *e = url_escape_table[c];
- if (e && c!='+' && c!='&' && c!='+') {
+ if (e && c!='+' && c!='&') {
html_raw(txt, t - txt);
- html_raw(e, 3);
+ html(e);
txt = t+1;
}
t++;
@@ -177,11 +179,13 @@ void html_url_arg(const char *txt)
{
const char *t = txt;
while(t && *t){
- int c = *t;
+ unsigned char c = *t;
const char *e = url_escape_table[c];
+ if (c == ' ')
+ e = "+";
if (e) {
html_raw(txt, t - txt);
- html_raw(e, 3);
+ html(e);
txt = t+1;
}
t++;
@@ -211,6 +215,14 @@ void html_option(const char *value, const char *text, const char *selected_value
html("\n");
}
+void html_intoption(int value, const char *text, int selected_value)
+{
+ htmlf("");
+}
+
void html_link_open(const char *url, const char *title, const char *class)
{
html("