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:
parent
9eb5f4cfb1
commit
7acc38df70
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue