From b20ed4f455bacf551d3258f2621ebd43fd62002b Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 27 Apr 2026 07:55:17 +0000 Subject: [PATCH] do not set App::$profile for removed channels and minor cleanup --- Zotlabs/Module/Profile.php | 7 +++---- Zotlabs/Widget/Fullprofile.php | 7 +++++-- Zotlabs/Widget/Profile.php | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Zotlabs/Module/Profile.php b/Zotlabs/Module/Profile.php index 732beaa6a..e5a9befcf 100644 --- a/Zotlabs/Module/Profile.php +++ b/Zotlabs/Module/Profile.php @@ -60,19 +60,18 @@ class Profile extends Controller { 'rel' => 'alternate', 'type' => 'application/atom+xml', 'title' => t('Posts and comments'), - 'href' => z_root() . '/feed/' . $which + 'href' => z_root() . '/feed/' . $which . '?top=0' ]); head_add_link([ 'rel' => 'alternate', 'type' => 'application/atom+xml', 'title' => t('Only posts'), - 'href' => z_root() . '/feed/' . $which . '?f=&top=1' + 'href' => z_root() . '/feed/' . $which . '?top=1' ]); - if (!$profile) { - $x = q("select channel_id as profile_uid from channel where channel_address = '%s' limit 1", + $x = q("select channel_id as profile_uid from channel where channel_address = '%s' and channel_removed = 0 limit 1", dbesc(argv(1)) ); if ($x) { diff --git a/Zotlabs/Widget/Fullprofile.php b/Zotlabs/Widget/Fullprofile.php index e40188c9e..bf051e2d7 100644 --- a/Zotlabs/Widget/Fullprofile.php +++ b/Zotlabs/Widget/Fullprofile.php @@ -8,15 +8,18 @@ namespace Zotlabs\Widget; +use App; + class Fullprofile { function widget($arr) { - if(!(isset(\App::$profile['profile_uid']) && \App::$profile['profile_uid'])) + if (empty(App::$profile['profile_uid'])) { return; + } $block = observer_prohibited(); - return profile_sidebar(\App::$profile, $block, true, true); + return profile_sidebar(App::$profile, $block, true, true); } } diff --git a/Zotlabs/Widget/Profile.php b/Zotlabs/Widget/Profile.php index 9e04524c1..88a704ce1 100644 --- a/Zotlabs/Widget/Profile.php +++ b/Zotlabs/Widget/Profile.php @@ -13,7 +13,7 @@ use App; class Profile { function widget($args) { - if(!isset(App::$profile['profile_uid'])) { + if (empty(App::$profile['profile_uid'])) { return; }