diff --git a/app/Services/Micropub/Handlers/UpdateHandler.php b/app/Services/Micropub/Handlers/UpdateHandler.php index e252b243..354cdbdd 100644 --- a/app/Services/Micropub/Handlers/UpdateHandler.php +++ b/app/Services/Micropub/Handlers/UpdateHandler.php @@ -53,7 +53,7 @@ class UpdateHandler implements MicropubHandlerInterface if ($data->updateReplace !== null) { foreach ($data->updateReplace as $property => $value) { match ($property) { - 'content' => $note->note = is_array($value[0]) ? ($value[0]['html'] ?? $value[0]['value'] ?? null) : $value[0], + 'content' => $note->note = $value[0], 'syndication' => $this->applySyndication($note, $value), default => null, }; diff --git a/tests/Feature/MicropubControllerTest.php b/tests/Feature/MicropubControllerTest.php index f694916b..10d129c0 100644 --- a/tests/Feature/MicropubControllerTest.php +++ b/tests/Feature/MicropubControllerTest.php @@ -538,29 +538,6 @@ class MicropubControllerTest extends TestCase $this->assertSame('replaced content', $note->content); } - #[Test] - public function micropub_client_api_request_updates_existing_note_with_rich_text_content(): void - { - $note = Note::factory()->create(); - $response = $this->postJson( - '/api/post', - [ - 'action' => 'update', - 'url' => $note->uri, - 'replace' => [ - 'content' => [['value' => 'plain text', 'html' => 'html version']], - ], - ], - ['HTTP_Authorization' => 'Bearer ' . $this->getToken()] - ); - $response - ->assertJson(['response' => 'updated']) - ->assertSuccessful(); - - $note->refresh(); - $this->assertSame('html version', $note->content); - } - #[Test] public function micropub_client_api_request_updates_note_syndication_links(): void {