mirror of
https://github.com/friendica/friendica
synced 2025-04-22 11:10:11 +00:00
Switch static::$parameters
to $this->parameters
This commit is contained in:
parent
489cd0884a
commit
5879535822
116 changed files with 321 additions and 314 deletions
|
@ -33,12 +33,12 @@ class Followers extends BaseModule
|
|||
{
|
||||
public function rawContent()
|
||||
{
|
||||
if (empty(static::$parameters['nickname'])) {
|
||||
if (empty($this->parameters['nickname'])) {
|
||||
throw new \Friendica\Network\HTTPException\NotFoundException();
|
||||
}
|
||||
|
||||
// @TODO: Replace with parameter from router
|
||||
$owner = User::getOwnerDataByNick(static::$parameters['nickname']);
|
||||
$owner = User::getOwnerDataByNick($this->parameters['nickname']);
|
||||
if (empty($owner)) {
|
||||
throw new \Friendica\Network\HTTPException\NotFoundException();
|
||||
}
|
||||
|
|
|
@ -33,11 +33,11 @@ class Following extends BaseModule
|
|||
{
|
||||
public function rawContent()
|
||||
{
|
||||
if (empty(static::$parameters['nickname'])) {
|
||||
if (empty($this->parameters['nickname'])) {
|
||||
throw new \Friendica\Network\HTTPException\NotFoundException();
|
||||
}
|
||||
|
||||
$owner = User::getOwnerDataByNick(static::$parameters['nickname']);
|
||||
$owner = User::getOwnerDataByNick($this->parameters['nickname']);
|
||||
if (empty($owner)) {
|
||||
throw new \Friendica\Network\HTTPException\NotFoundException();
|
||||
}
|
||||
|
|
|
@ -50,12 +50,12 @@ class Inbox extends BaseModule
|
|||
$filename = 'failed-activitypub';
|
||||
}
|
||||
$tempfile = tempnam(System::getTempPath(), $filename);
|
||||
file_put_contents($tempfile, json_encode(['parameters' => static::$parameters, 'header' => $_SERVER, 'body' => $postdata], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
|
||||
file_put_contents($tempfile, json_encode(['parameters' => $this->parameters, 'header' => $_SERVER, 'body' => $postdata], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
|
||||
Logger::notice('Incoming message stored', ['file' => $tempfile]);
|
||||
}
|
||||
|
||||
if (!empty(static::$parameters['nickname'])) {
|
||||
$user = DBA::selectFirst('user', ['uid'], ['nickname' => static::$parameters['nickname']]);
|
||||
if (!empty($this->parameters['nickname'])) {
|
||||
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $this->parameters['nickname']]);
|
||||
if (!DBA::isResult($user)) {
|
||||
throw new \Friendica\Network\HTTPException\NotFoundException();
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ class Objects extends BaseModule
|
|||
{
|
||||
public function rawContent()
|
||||
{
|
||||
if (empty(static::$parameters['guid'])) {
|
||||
if (empty($this->parameters['guid'])) {
|
||||
throw new HTTPException\BadRequestException();
|
||||
}
|
||||
|
||||
|
@ -51,10 +51,10 @@ class Objects extends BaseModule
|
|||
DI::baseUrl()->redirect(str_replace('objects/', 'display/', DI::args()->getQueryString()));
|
||||
}
|
||||
|
||||
$itemuri = DBA::selectFirst('item-uri', ['id'], ['guid' => static::$parameters['guid']]);
|
||||
$itemuri = DBA::selectFirst('item-uri', ['id'], ['guid' => $this->parameters['guid']]);
|
||||
|
||||
if (DBA::isResult($itemuri)) {
|
||||
Logger::info('Provided GUID found.', ['guid' => static::$parameters['guid'], 'uri-id' => $itemuri['id']]);
|
||||
Logger::info('Provided GUID found.', ['guid' => $this->parameters['guid'], 'uri-id' => $itemuri['id']]);
|
||||
} else {
|
||||
// The item URI does not always contain the GUID. This means that we have to search the URL instead
|
||||
$url = DI::baseUrl()->get() . '/' . DI::args()->getQueryString();
|
||||
|
@ -104,11 +104,11 @@ class Objects extends BaseModule
|
|||
throw new HTTPException\NotFoundException();
|
||||
}
|
||||
|
||||
$etag = md5(static::$parameters['guid'] . '-' . $item['changed']);
|
||||
$etag = md5($this->parameters['guid'] . '-' . $item['changed']);
|
||||
$last_modified = $item['changed'];
|
||||
Network::checkEtagModified($etag, $last_modified);
|
||||
|
||||
if (empty(static::$parameters['activity']) && ($item['gravity'] != GRAVITY_ACTIVITY)) {
|
||||
if (empty($this->parameters['activity']) && ($item['gravity'] != GRAVITY_ACTIVITY)) {
|
||||
$activity = ActivityPub\Transmitter::createActivityFromItem($item['id'], true);
|
||||
if (empty($activity['type'])) {
|
||||
throw new HTTPException\NotFoundException();
|
||||
|
@ -123,16 +123,16 @@ class Objects extends BaseModule
|
|||
|
||||
$data = ['@context' => ActivityPub::CONTEXT];
|
||||
$data = array_merge($data, $activity['object']);
|
||||
} elseif (empty(static::$parameters['activity']) || in_array(static::$parameters['activity'],
|
||||
} elseif (empty($this->parameters['activity']) || in_array($this->parameters['activity'],
|
||||
['Create', 'Announce', 'Update', 'Like', 'Dislike', 'Accept', 'Reject',
|
||||
'TentativeAccept', 'Follow', 'Add'])) {
|
||||
$data = ActivityPub\Transmitter::createActivityFromItem($item['id']);
|
||||
if (empty($data)) {
|
||||
throw new HTTPException\NotFoundException();
|
||||
}
|
||||
if (!empty(static::$parameters['activity']) && (static::$parameters['activity'] != 'Create')) {
|
||||
$data['type'] = static::$parameters['activity'];
|
||||
$data['id'] = str_replace('/Create', '/' . static::$parameters['activity'], $data['id']);
|
||||
if (!empty($this->parameters['activity']) && ($this->parameters['activity'] != 'Create')) {
|
||||
$data['type'] = $this->parameters['activity'];
|
||||
$data['id'] = str_replace('/Create', '/' . $this->parameters['activity'], $data['id']);
|
||||
}
|
||||
} else {
|
||||
throw new HTTPException\NotFoundException();
|
||||
|
|
|
@ -33,11 +33,11 @@ class Outbox extends BaseModule
|
|||
{
|
||||
public function rawContent()
|
||||
{
|
||||
if (empty(static::$parameters['nickname'])) {
|
||||
if (empty($this->parameters['nickname'])) {
|
||||
throw new \Friendica\Network\HTTPException\NotFoundException();
|
||||
}
|
||||
|
||||
$owner = User::getOwnerDataByNick(static::$parameters['nickname']);
|
||||
$owner = User::getOwnerDataByNick($this->parameters['nickname']);
|
||||
if (empty($owner)) {
|
||||
throw new \Friendica\Network\HTTPException\NotFoundException();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue