@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhabricatorFlagDeleteController extends PhabricatorFlagController {
4
5
6 public function handleRequest(AphrontRequest $request) {
7 $viewer = $request->getViewer();
8 $id = $request->getURIData('id');
9
10 $flag = id(new PhabricatorFlag())->load($id);
11 if (!$flag) {
12 return new Aphront404Response();
13 }
14
15 if ($flag->getOwnerPHID() != $viewer->getPHID()) {
16 return new Aphront400Response();
17 }
18
19 $flag->delete();
20
21 return id(new AphrontReloadResponse())->setURI('/flag/');
22 }
23
24}