X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FFeed.php;h=1465e10e7196a349ecf999924b20c8a10d2fa001;hb=b36d4eb0dd4bdc25a468c95c749bfae1b6324be9;hp=8db92c275a7a067c78628b8f90ed335b9ac9e05a;hpb=3842f02b021f2f32dbe6707c22af5760c3353dfa;p=friendica.git diff --git a/src/Module/Feed.php b/src/Module/Feed.php index 8db92c275a..1465e10e71 100644 --- a/src/Module/Feed.php +++ b/src/Module/Feed.php @@ -22,9 +22,11 @@ namespace Friendica\Module; use Friendica\BaseModule; +use Friendica\Core\Session; use Friendica\Core\System; use Friendica\DI; use Friendica\Protocol\Feed as ProtocolFeed; +use Friendica\Network\HTTPException; /** * Provides public Atom feeds @@ -42,10 +44,10 @@ use Friendica\Protocol\Feed as ProtocolFeed; */ class Feed extends BaseModule { - protected function content(array $request = []): string + protected function rawContent(array $request = []) { - $last_update = $request['last_update'] ?? ''; - $nocache = !empty($request['nocache']) && local_user(); + $last_update = $this->getRequestValue($request, 'last_update', ''); + $nocache = !empty($request['nocache']) && Session::getLocalUser(); $type = null; // @TODO: Replace with parameter from router @@ -66,6 +68,11 @@ class Feed extends BaseModule $type = 'posts'; } - System::httpExit(ProtocolFeed::atom($this->parameters['nickname'], $last_update, 10, $type, $nocache, true), Response::TYPE_ATOM); + $feed = ProtocolFeed::atom($this->parameters['nickname'], $last_update, 10, $type, $nocache, true); + if (empty($feed)) { + throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.')); + } + + System::httpExit($feed, Response::TYPE_ATOM); } }