pub fn validate_message_content(
input: &str,
max_len: usize,
) -> Result<String, ValidationError>Expand description
Validate and sanitize message content from channels.
Performs:
- Length check (prevent memory exhaustion)
- Strip null bytes and control chars (except newlines/tabs)
- Unicode normalization (NFKC - prevent homograph attacks)
ยงErrors
Returns ValidationError::TooLong if input exceeds max_len.