Move System::httpError to BaseModule->httpError

- This will ensure headers set in BaseModule->run will be carried in httpError scenarios
- Deprecate httpError() method in Core\System
This commit is contained in:
Hypolite Petovan 2023-09-21 12:45:24 -04:00
parent da1416c07f
commit e424b7bacb
5 changed files with 35 additions and 11 deletions

View file

@ -57,12 +57,12 @@ class Share extends \Friendica\BaseModule
{
$post_id = $this->parameters['post_id'];
if (!$post_id || !$this->session->getLocalUserId()) {
System::httpError(403);
$this->httpError(403);
}
$item = Post::selectFirst(['private', 'body', 'uri', 'plink', 'network'], ['id' => $post_id]);
if (!$item || $item['private'] == Item::PRIVATE) {
System::httpError(404);
$this->httpError(404);
}
$shared = $this->contentItem->getSharedPost($item, ['uri']);