]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Feed.php
Merge pull request #7044 from MrPetovan/task/router
[friendica.git] / src / Module / Feed.php
index 2be12f13e48ce8204c79e187c09e630f8ea9d189..eabd45da23eef073fef2af295390a2b3bdd4fa0a 100644 (file)
@@ -20,7 +20,7 @@ use Friendica\Protocol\OStatus;
  *
  * @brief Provides public Atom feeds
  *
- * @author Hypolite Petovan <mrpetovan@gmail.com>
+ * @author Hypolite Petovan <hypolite@mrpetovan.com>
  */
 class Feed extends BaseModule
 {
@@ -28,14 +28,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 = defaults($_GET, 'last_update', '');
+               $nocache     = !empty($_GET['nocache']) && local_user();
 
+               // @TODO: Replace with parameter from router
                if ($a->argc < 2) {
                        System::httpExit(400);
                }
 
                $type = null;
+               // @TODO: Replace with parameter from router
                if ($a->argc > 2) {
                        $type = $a->argv[2];
                }
@@ -44,6 +46,7 @@ class Feed extends BaseModule
                        case 'posts':
                        case 'comments':
                        case 'activity':
+                               // Correct type names, no change needed
                                break;
                        case 'replies':
                                $type = 'comments';
@@ -52,9 +55,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();
        }
 }