X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FModule%2FFriendica.php;h=3fccda5f859ddd429adb34a8e21e23e3c521ca83;hb=d7df0825db598012871d8555de04575d0c30247a;hp=f02cc2610b803888d1f75232c720dcf69a9007cc;hpb=c6b45a958e3b09bc8f3950a718c181dfc9e0b910;p=friendica.git
diff --git a/src/Module/Friendica.php b/src/Module/Friendica.php
index f02cc2610b..3fccda5f85 100644
--- a/src/Module/Friendica.php
+++ b/src/Module/Friendica.php
@@ -1,6 +1,6 @@
' . FRIENDICA_VERSION . '',
DI::baseUrl()->get(),
'' . DB_UPDATE_VERSION . '/' . $config->get('system', 'build') .'',
- '' . $config->get('system', 'post_update_version') . ''),
+ '' . PostUpdate::VERSION . '/' . $config->get('system', 'post_update_version') . ''),
'friendica' => DI::l10n()->t('Please visit Friendi.ca to learn more about the Friendica project.'),
'bugs' => DI::l10n()->t('Bug reports and issues: please visit') . ' ' . '' . DI::l10n()->t('the bugtracker at github') . '',
'info' => DI::l10n()->t('Suggestions, praise, etc. - please email "info" at "friendi - dot - ca'),
@@ -108,24 +110,24 @@ class Friendica extends BaseModule
]);
}
- public static function rawContent(array $parameters = [])
+ protected function rawContent(array $request = [])
{
- if (ActivityPub::isRequest()) {
- $data = ActivityPub\Transmitter::getProfile(0);
- if (!empty($data)) {
+ // @TODO: Replace with parameter from router
+ if (DI::args()->getArgc() <= 1 || (DI::args()->getArgv()[1] !== 'json')) {
+ if (!ActivityPub::isRequest()) {
+ return;
+ }
+
+ try {
+ $data = ActivityPub\Transmitter::getProfile(0);
header('Access-Control-Allow-Origin: *');
header('Cache-Control: max-age=23200, stale-while-revalidate=23200');
System::jsonExit($data, 'application/activity+json');
+ } catch (HTTPException\NotFoundException $e) {
+ System::jsonError(404, ['error' => 'Record not found']);
}
}
- $app = DI::app();
-
- // @TODO: Replace with parameter from router
- if ($app->argc <= 1 || ($app->argv[1] !== 'json')) {
- return;
- }
-
$config = DI::config();
$register_policies = [