From 0a83d6a3f27b90355d450ce6b8390303c169a47f Mon Sep 17 00:00:00 2001 From: winter Date: Mon, 24 Mar 2025 19:19:11 +0000 Subject: [breaking] change poke extension to use form-urlencoded instead of json https://pawpub.entities.org.uk/extension/poke?do=diff&rev2%5B0%5D=1742657519&rev2%5B1%5D=1742841374&difftype=sidebyside --- routes/actor.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'routes') diff --git a/routes/actor.php b/routes/actor.php index a459640..7bf0250 100644 --- a/routes/actor.php +++ b/routes/actor.php @@ -163,7 +163,7 @@ Router::getInstance()->mount('/actor/:id/poke', function (array $args) { if ($initiator == null) { throw new Unauthorized('please authenticate yourself on behalf of the initiating actor'); } - $body = file_get_contents('php://input'); - $obj = json_decode($body); - $initiator->poke($target, PokeVerb::tryFrom($obj?->verb ?? '') ?? PokeVerb::POKE, $obj?->urgent ?? false); + $verb = PokeVerb::tryFrom($_POST['verb'] ?? '') ?? PokeVerb::POKE; + $urgent = isset($_POST['urgent']); + $initiator->poke($target, $verb, $urgent); }); \ No newline at end of file -- cgit v1.3