Fix UpdateHandler crash when replace.content is a rich-text object
OwnYourSwarm sends content as an array of objects with `value` and `html` keys per the Micropub spec. The handler now handles both forms: plain strings and rich objects, preferring `html` over `value`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
4451fc247e
commit
e8e2bff5e4
2 changed files with 24 additions and 1 deletions
|
|
@ -53,7 +53,7 @@ class UpdateHandler implements MicropubHandlerInterface
|
|||
if ($data->updateReplace !== null) {
|
||||
foreach ($data->updateReplace as $property => $value) {
|
||||
match ($property) {
|
||||
'content' => $note->note = $value[0],
|
||||
'content' => $note->note = is_array($value[0]) ? ($value[0]['html'] ?? $value[0]['value'] ?? null) : $value[0],
|
||||
'syndication' => $this->applySyndication($note, $value),
|
||||
default => null,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue