X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FFeed.php;h=49ecfed96c166cd6d6676f77816ec1a100e77e43;hb=b543ee8ac78168328c7a7f2d725ee01bb333e941;hp=2be12f13e48ce8204c79e187c09e630f8ea9d189;hpb=29f7ebe307c22b275466390937b82ccb3820fb1c;p=friendica.git diff --git a/src/Module/Feed.php b/src/Module/Feed.php index 2be12f13e4..49ecfed96c 100644 --- a/src/Module/Feed.php +++ b/src/Module/Feed.php @@ -3,7 +3,6 @@ namespace Friendica\Module; use Friendica\BaseModule; -use Friendica\Core\System; use Friendica\Protocol\OStatus; /** @@ -20,7 +19,7 @@ use Friendica\Protocol\OStatus; * * @brief Provides public Atom feeds * - * @author Hypolite Petovan + * @author Hypolite Petovan */ class Feed extends BaseModule { @@ -28,14 +27,16 @@ class Feed extends BaseModule { $a = self::getApp(); - $last_update = x($_GET, 'last_update') ? $_GET['last_update'] : ''; - $nocache = x($_GET, 'nocache') && local_user(); + $last_update = $_GET['last_update'] ?? ''; + $nocache = !empty($_GET['nocache']) && local_user(); + // @TODO: Replace with parameter from router if ($a->argc < 2) { - System::httpExit(400); + throw new \Friendica\Network\HTTPException\BadRequestException(); } $type = null; + // @TODO: Replace with parameter from router if ($a->argc > 2) { $type = $a->argv[2]; } @@ -44,6 +45,7 @@ class Feed extends BaseModule case 'posts': case 'comments': case 'activity': + // Correct type names, no change needed break; case 'replies': $type = 'comments'; @@ -52,9 +54,10 @@ class Feed extends BaseModule $type = 'posts'; } + // @TODO: Replace with parameter from router $nickname = $a->argv[1]; - header("Content-type: application/atom+xml"); - echo OStatus::feed($nickname, $last_update, 10, $type, $nocache); - killme(); + header("Content-type: application/atom+xml; charset=utf-8"); + echo OStatus::feed($nickname, $last_update, 10, $type, $nocache, true); + exit(); } }