aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes
diff options
context:
space:
mode:
authorwinter2025-01-27 21:28:29 +0000
committerwinter2025-01-27 21:28:29 +0000
commit8fc56f62bad41a30060b527ee2707c07946e0edf (patch)
treec02bdcf467aafc8c281f9ce2c4703f56ea54de30 /routes
parent953464284df0b6c05a8a9b61dd66befa64181083 (diff)
prevent deleting remote notes
Diffstat (limited to 'routes')
-rw-r--r--routes/note_fragment.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/routes/note_fragment.php b/routes/note_fragment.php
index 143697f..9d3b9bb 100644
--- a/routes/note_fragment.php
+++ b/routes/note_fragment.php
@@ -20,6 +20,9 @@ Router::getInstance()->mount('/fragment/note/:id', function (array $args) {
if ($note->author != $user->actor && !$user->isAdmin) {
throw new Forbidden('you may not delete that note!');
}
+ if (!$note->author->isLocal) {
+ throw new BadRequest("can't delete a non-local note");
+ }
$note->markDeleted();
// no need to return any template because it's just gone