mirror of
https://github.com/friendica/friendica
synced 2025-05-07 16:24:11 +02:00
Replace $parameters
argument per method with static::$parameters
This commit is contained in:
parent
018275919c
commit
714f0febc4
249 changed files with 710 additions and 775 deletions
|
@ -41,9 +41,9 @@ use Friendica\Util\Strings;
|
|||
*/
|
||||
class Objects extends BaseModule
|
||||
{
|
||||
public static function rawContent(array $parameters = [])
|
||||
public static function rawContent()
|
||||
{
|
||||
if (empty($parameters['guid'])) {
|
||||
if (empty(static::$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' => $parameters['guid']]);
|
||||
$itemuri = DBA::selectFirst('item-uri', ['id'], ['guid' => static::$parameters['guid']]);
|
||||
|
||||
if (DBA::isResult($itemuri)) {
|
||||
Logger::info('Provided GUID found.', ['guid' => $parameters['guid'], 'uri-id' => $itemuri['id']]);
|
||||
Logger::info('Provided GUID found.', ['guid' => static::$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($parameters['guid'] . '-' . $item['changed']);
|
||||
$etag = md5(static::$parameters['guid'] . '-' . $item['changed']);
|
||||
$last_modified = $item['changed'];
|
||||
Network::checkEtagModified($etag, $last_modified);
|
||||
|
||||
if (empty($parameters['activity']) && ($item['gravity'] != GRAVITY_ACTIVITY)) {
|
||||
if (empty(static::$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($parameters['activity']) || in_array($parameters['activity'],
|
||||
} elseif (empty(static::$parameters['activity']) || in_array(static::$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($parameters['activity']) && ($parameters['activity'] != 'Create')) {
|
||||
$data['type'] = $parameters['activity'];
|
||||
$data['id'] = str_replace('/Create', '/' . $parameters['activity'], $data['id']);
|
||||
if (!empty(static::$parameters['activity']) && (static::$parameters['activity'] != 'Create')) {
|
||||
$data['type'] = static::$parameters['activity'];
|
||||
$data['id'] = str_replace('/Create', '/' . static::$parameters['activity'], $data['id']);
|
||||
}
|
||||
} else {
|
||||
throw new HTTPException\NotFoundException();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue