1
0
Fork 0
mirror of https://github.com/Nutomic/ibis.git synced 2024-11-22 09:01:09 +00:00

Dont allow / in article title (fixes #25)

This commit is contained in:
Felix Ableitner 2024-03-14 10:30:18 +01:00
parent 8188296b88
commit 3128cbaefb

View file

@ -47,6 +47,9 @@ pub(in crate::backend::api) async fn create_article(
if create_article.title.is_empty() {
return Err(anyhow!("Title must not be empty").into());
}
if create_article.title.contains('/') {
return Err(anyhow!("Invalid character `/`").into());
}
let local_instance = DbInstance::read_local_instance(&data)?;
let escaped_title = create_article.title.replace(' ', "_");