]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Feed.php
Merge pull request #7726 from tobiasd/20191010-uexport
[friendica.git] / src / Module / Feed.php
index 4c7059c038dc0bb221699f4c3840dcad3606f2bf..49ecfed96c166cd6d6676f77816ec1a100e77e43 100644 (file)
@@ -3,7 +3,6 @@
 namespace Friendica\Module;
 
 use Friendica\BaseModule;
-use Friendica\Core\System;
 use Friendica\Protocol\OStatus;
 
 /**
@@ -28,14 +27,16 @@ class Feed extends BaseModule
        {
                $a = self::getApp();
 
-               $last_update = defaults($_GET, 'last_update', '');
+               $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");
+               header("Content-type: application/atom+xml; charset=utf-8");
                echo OStatus::feed($nickname, $last_update, 10, $type, $nocache, true);
-               killme();
+               exit();
        }
 }