[verified] sanitize peer chat/control/bidi before store and TUI render
Some checks failed
ci / test (pull_request) Failing after 2m2s
Some checks failed
ci / test (pull_request) Failing after 2m2s
Strip C0 (except tab/newline), DEL, C1, and bidi/format marks at ingest and render; keep ZWJ; lossy UTF-8 stays U+FFFD. Reject the same set in fil names. Docs match the policy.
This commit is contained in:
parent
cb91ba2b78
commit
e3738c51f7
9 changed files with 181 additions and 5 deletions
|
|
@ -10,6 +10,7 @@ use ratatui::{DefaultTerminal, Frame};
|
|||
|
||||
use crate::node::Node;
|
||||
use crate::qr::{self, QrPayload};
|
||||
use crate::sanitize;
|
||||
use crate::store::{Friend, FriendProfile};
|
||||
|
||||
const C_ACCENT: Color = Color::Rgb(232, 165, 75);
|
||||
|
|
@ -1458,7 +1459,7 @@ impl App {
|
|||
.iter()
|
||||
.map(|m| {
|
||||
let side = if m.dir == "out" { "you" } else { "them" };
|
||||
format!("{side}: {}", String::from_utf8_lossy(&m.plaintext))
|
||||
format!("{side}: {}", sanitize::display_text(&m.plaintext))
|
||||
})
|
||||
.collect(),
|
||||
Err(e) => vec![e],
|
||||
|
|
|
|||
Loading…
Reference in a new issue