Add routes for current BaseModules

This commit is contained in:
Philipp Holzer 2019-05-01 21:29:04 +02:00
parent b6b9e57488
commit 07ba1b200c
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
16 changed files with 806 additions and 722 deletions

View file

@ -5,11 +5,10 @@
namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Protocol\ActivityPub;
use Friendica\Core\System;
use Friendica\Model\Item;
use Friendica\Database\DBA;
use Friendica\Util\HTTPSignature;
use Friendica\Model\Item;
use Friendica\Protocol\ActivityPub;
/**
* ActivityPub Objects
@ -32,9 +31,11 @@ class Objects extends BaseModule
// $requester = HTTPSignature::getSigner('', $_SERVER);
// At first we try the original post with that guid
// @TODO: Replace with parameter from router
$item = Item::selectFirst(['id'], ['guid' => $a->argv[1], 'origin' => true, 'private' => false]);
if (!DBA::isResult($item)) {
// If no original post could be found, it could possibly be a forum post, there we remove the "origin" field.
// @TODO: Replace with parameter from router
$item = Item::selectFirst(['id', 'author-link'], ['guid' => $a->argv[1], 'private' => false]);
if (!DBA::isResult($item) || !strstr($item['author-link'], System::baseUrl())) {
System::httpExit(404);