trim and lowercase search input

This commit is contained in:
aglkm
2024-11-14 15:46:07 +03:00
parent 84d3588708
commit d548a08ab8

View File

@@ -171,6 +171,9 @@ pub async fn search(input: Option<&str>) -> Either<Template, Redirect> {
})),
};
// Trim and lowercase the input
let input = input.trim().to_lowercase();
// Check for valid chars
if input.chars().all(|x| (x >= 'a' && x <= 'f') || (x >= '0' && x <= '9')) == true {