mirror of
https://github.com/friendica/friendica
synced 2025-04-27 08:30:10 +00:00
Move System::jsonExit to BaseModule->jsonExit
- This will ensure headers set in BaseModule->run will be carried in jsonExit scenarios - Deprecate jsonExit() method in Core\System
This commit is contained in:
parent
e424b7bacb
commit
81279dad9e
119 changed files with 165 additions and 162 deletions
|
@ -159,7 +159,7 @@ class Statuses extends BaseApi
|
|||
|
||||
Item::updateDisplayCache($post['uri-id']);
|
||||
|
||||
System::jsonExit(DI::mstdnStatus()->createFromUriId($post['uri-id'], $uid, self::appSupportsQuotes()));
|
||||
$this->jsonExit(DI::mstdnStatus()->createFromUriId($post['uri-id'], $uid, self::appSupportsQuotes()));
|
||||
}
|
||||
|
||||
protected function post(array $request = [])
|
||||
|
@ -299,14 +299,14 @@ class Statuses extends BaseApi
|
|||
if (empty($id)) {
|
||||
DI::mstdnError()->InternalError();
|
||||
}
|
||||
System::jsonExit(DI::mstdnScheduledStatus()->createFromDelayedPostId($id, $uid)->toArray());
|
||||
$this->jsonExit(DI::mstdnScheduledStatus()->createFromDelayedPostId($id, $uid)->toArray());
|
||||
}
|
||||
|
||||
$id = Item::insert($item, true);
|
||||
if (!empty($id)) {
|
||||
$item = Post::selectFirst(['uri-id'], ['id' => $id]);
|
||||
if (!empty($item['uri-id'])) {
|
||||
System::jsonExit(DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, self::appSupportsQuotes()));
|
||||
$this->jsonExit(DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, self::appSupportsQuotes()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -331,7 +331,7 @@ class Statuses extends BaseApi
|
|||
DI::mstdnError()->RecordNotFound();
|
||||
}
|
||||
|
||||
System::jsonExit([]);
|
||||
$this->jsonExit([]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -345,7 +345,7 @@ class Statuses extends BaseApi
|
|||
DI::mstdnError()->UnprocessableEntity();
|
||||
}
|
||||
|
||||
System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), false));
|
||||
$this->jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), false));
|
||||
}
|
||||
|
||||
private function getApp(): string
|
||||
|
@ -422,7 +422,7 @@ class Statuses extends BaseApi
|
|||
if (preg_match("/\[url=[^\[\]]*\](.*)\[\/url\]\z/ism", $status, $matches)) {
|
||||
$status = preg_replace("/\[url=[^\[\]]*\].*\[\/url\]\z/ism", PageInfo::getFooterFromUrl($matches[1]), $status);
|
||||
}
|
||||
|
||||
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue