From 1dc61ace13096738a0d1e34579aa823523ef7f4d Mon Sep 17 00:00:00 2001
From: Yonle
Date: Sat, 15 Jul 2023 00:35:41 +0700
Subject: [PATCH 1/4] html.c: Probably put placeholder on certain input and
textboxes
Signed-off-by: Yonle
---
html.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/html.c b/html.c
index 847a715..fadc29a 100644
--- a/html.c
+++ b/html.c
@@ -395,7 +395,7 @@ d_char *html_top_controls(snac *snac, d_char *s)
"
\n"
"%s:
\n"
" "
@@ -533,7 +533,7 @@ d_char *html_top_controls(snac *snac, d_char *s)
L("Sensitive content description"),
L("Only for mentioned people"),
- L("Attach..."),
+ L("Attachment..."),
L("File"),
L("File description"),
@@ -555,7 +555,7 @@ d_char *html_top_controls(snac *snac, d_char *s)
snac->actor,
L("Boost"), L("(by URL)"),
- L("User setup..."),
+ L("User settings...."),
snac->actor,
L("Display name"),
es1,
@@ -575,8 +575,8 @@ d_char *html_top_controls(snac *snac, d_char *s)
L("Drop direct messages from people you don't follow"),
xs_type(bot) == XSTYPE_TRUE ? "checked" : "",
L("This account is a bot"),
- L("New Password"),
- L("Repeat New Password"),
+ L("New password"),
+ L("Repeat new password"),
L("Update user info")
);
From 299886d8984686bb5f6c0e1135e191fcc9b63518 Mon Sep 17 00:00:00 2001
From: Yonle
Date: Sat, 15 Jul 2023 00:39:42 +0700
Subject: [PATCH 2/4] utils.c: "User id" does not need "\n".
Signed-off-by: Yonle
---
utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utils.c b/utils.c
index 648f9bf..fc102e4 100644
--- a/utils.c
+++ b/utils.c
@@ -225,7 +225,7 @@ int adduser(const char *uid)
FILE *f;
if (uid == NULL) {
- printf("User id:\n");
+ printf("Username: ");
uid = xs_strip_i(xs_readline(stdin));
}
From 98c72db17c07fac90bf1893c45e4a67e7e2ec173 Mon Sep 17 00:00:00 2001
From: Yonle
Date: Sat, 15 Jul 2023 02:06:10 +0700
Subject: [PATCH 3/4] html.c: *prev_src at edit: Just use encode_html.
Signed-off-by: Yonle
---
html.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/html.c b/html.c
index fadc29a..e4703d1 100644
--- a/html.c
+++ b/html.c
@@ -712,7 +712,7 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch
const char *prev_src1 = xs_dict_get(msg, "sourceContent");
if (!xs_is_null(prev_src1) && strcmp(actor, snac->actor) == 0) { /** edit **/
- xs *prev_src = xs_replace(prev_src1, "<", "<");
+ xs *prev_src = encode_html(prev_src1);
const xs_val *sensitive = xs_dict_get(msg, "sensitive");
const char *summary = xs_dict_get(msg, "summary");
From 7e40e0d78391e63aef24f43af2fdfac8b6dd34f1 Mon Sep 17 00:00:00 2001
From: Yonle
Date: Sat, 15 Jul 2023 02:14:33 +0700
Subject: [PATCH 4/4] html.c: invalid html tag: else? just show it as encoded
text.
Signed-off-by: Yonle
---
format.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/format.c b/format.c
index 4491ae0..8c6c02a 100644
--- a/format.c
+++ b/format.c
@@ -226,6 +226,10 @@ xs_str *sanitize(const char *content)
v[1] == '/' ? "/" : "", tag, xs_list_len(el) ? " " : "", s3);
s = xs_str_cat(s, s2);
+ } else {
+ /* else? just show it with encoded code.. that's it. */
+ xs *el = encode_html(v);
+ s = xs_str_cat(s, el);
}
}
else {