Remove null char from tag query

Gets rid of the occasional error message in logs from misbehaving clients
This commit is contained in:
Earlopain 2024-01-23 19:36:36 +01:00
parent 6ca7db0a08
commit 75a53598e8
No known key found for this signature in database
GPG Key ID: 48860312319ADF61

View File

@ -138,7 +138,7 @@ fn validate_transform_tag(tag: &str) -> Result<String, AutocompleteError> {
.nfc() .nfc()
.collect::<String>() .collect::<String>()
.to_lowercase() .to_lowercase()
.replace(['*', '%'], "") .replace(['*', '%', '\0'], "")
.chars() .chars()
.filter(|x| !x.is_whitespace()) .filter(|x| !x.is_whitespace())
.collect(); .collect();