]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Profile.php
Use correct entry list in Module\Directory
[friendica.git] / src / Module / Profile.php
index c3297d261a295ec9a8abc368f983aa1833f30d71..afebede4d0dcdf155145cfa9c8c51d0340d6a943 100644 (file)
@@ -38,7 +38,7 @@ class Profile extends BaseModule
 
                // @TODO: Replace with parameter from router
                if ($a->argc < 2) {
-                       System::httpExit(400);
+                       throw new \Friendica\Network\HTTPException\BadRequestException();
                }
 
                self::$which = filter_var($a->argv[1], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_BACKTICK);
@@ -178,12 +178,9 @@ class Profile extends BaseModule
                }
 
                if (!$update) {
-                       $tab = false;
-                       if (!empty($_GET['tab'])) {
-                               $tab = Strings::escapeTags(trim($_GET['tab']));
-                       }
+            $tab = Strings::escapeTags(trim(defaults($_GET, 'tab', '')));
 
-                       $o .= ProfileModel::getTabs($a, $is_owner, $a->profile['nickname']);
+                       $o .= ProfileModel::getTabs($a, $tab, $is_owner, $a->profile['nickname']);
 
                        if ($tab === 'profile') {
                                $o .= ProfileModel::getAdvanced($a);
@@ -196,8 +193,8 @@ class Profile extends BaseModule
                        $commpage = $a->profile['page-flags'] == User::PAGE_FLAGS_COMMUNITY;
                        $commvisitor = $commpage && $remote_contact;
 
-                       $a->page['aside'] .= posted_date_widget(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], $a->profile['profile_uid'], true);
-                       $a->page['aside'] .= Widget::categories(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], (!empty($category) ? XML::escape($category) : ''));
+                       $a->page['aside'] .= Widget::postedByYear(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], $a->profile['profile_uid'] ?? 0, true);
+                       $a->page['aside'] .= Widget::categories(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], XML::escape($category));
                        $a->page['aside'] .= Widget::tagCloud();
 
                        if (Security::canWriteToUserWall($a->profile['profile_uid'])) {