<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
$itemId = $this->parameters['id'];
if (in_array($verb, ['announce', 'unannounce'])) {
- $item = Post::selectFirst(['network', 'uri-id', 'uid'], ['id' => $itemId]);
+ $item = Post::selectFirst(['network', 'uri-id'], ['id' => $itemId, 'uid' => [Session::getLocalUser(), 0]]);
if ($item['network'] == Protocol::DIASPORA) {
- Diaspora::performReshare($item['uri-id'], $item['uid']);
+ Diaspora::performReshare($item['uri-id'], Session::getLocalUser());
}
}
- if (!Item::performActivity($itemId, $verb, local_user())) {
+ if (!Item::performActivity($itemId, $verb, Session::getLocalUser())) {
throw new HTTPException\BadRequestException();
}