From 058499cd929b0a162bdb720c8cbfb302534a7df3 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 18 May 2024 11:15:47 +0000 Subject: [PATCH] Fix: Undefined array key "content-warning" --- mod/item.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mod/item.php b/mod/item.php index 1f826a42d0..d6bcd39029 100644 --- a/mod/item.php +++ b/mod/item.php @@ -234,13 +234,15 @@ function item_insert(int $uid, array $request, bool $preview, string $return_pat function item_process(array $post, array $request, bool $preview, string $return_path): array { - $post['self'] = true; - $post['api_source'] = false; - $post['attach'] = ''; - $post['title'] = trim($request['title'] ?? ''); - $post['body'] = $request['body'] ?? ''; - $post['location'] = trim($request['location'] ?? ''); - $post['coord'] = trim($request['coord'] ?? ''); + $post['self'] = true; + $post['api_source'] = false; + $post['attach'] = ''; + $post['title'] = trim($request['title'] ?? ''); + $post['content-warning'] = trim($request['summary'] ?? ''); + $post['sensitive'] = !empty($request['sensitive'] ?? false); + $post['body'] = $request['body'] ?? ''; + $post['location'] = trim($request['location'] ?? ''); + $post['coord'] = trim($request['coord'] ?? ''); $post = DI::contentItem()->addCategories($post, $request['category'] ?? '');