Issue 11963: Set Permissions for attachments

This commit is contained in:
Michael 2024-05-10 17:14:05 +00:00
parent ee9510e17d
commit 567292533e
5 changed files with 90 additions and 65 deletions

View file

@ -45,7 +45,8 @@ use Friendica\Model\Post;
use Friendica\Network\HTTPException;
use Friendica\Util\DateTimeFormat;
function item_post(App $a) {
function item_post(App $a)
{
$uid = DI::userSession()->getLocalUserId();
if (!$uid) {
@ -248,7 +249,7 @@ function item_process(array $post, array $request, bool $preview, string $return
$post['body'] .= DI::contentItem()->storeAttachmentFromRequest($request);
}
$post = DI::contentItem()->finalizePost($post);
$post = DI::contentItem()->finalizePost($post, $preview);
if (!strlen($post['body'])) {
if ($preview) {
@ -286,7 +287,7 @@ function item_process(array $post, array $request, bool $preview, string $return
System::jsonExit(['preview' => $o]);
}
Hook::callAll('post_local',$post);
Hook::callAll('post_local', $post);
unset($post['edit']);
unset($post['self']);