1
0
Fork 0
mirror of https://github.com/Nutomic/ibis.git synced 2024-12-23 17:51:24 +00:00

Throw error when linking to local domain (ref #76)

This commit is contained in:
Felix Ableitner 2024-12-18 12:49:30 +01:00
parent 9eb5f4cfb1
commit 7acc38df70

View file

@ -121,6 +121,10 @@ pub(in crate::backend::api) async fn edit_article(
if !edit_form.new_text.ends_with('\n') {
edit_form.new_text.push('\n');
}
let local_link = format!("](https://{}", data.config.federation.domain);
if edit_form.new_text.contains(&local_link) {
return Err(anyhow!("Links to local instance don't work over federation").into());
}
if edit_form.previous_version_id == original_article.latest_version {
// No intermediate changes, simply submit new version