From b55801323c19928fc7cb82c007856087e3d6545a Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 3 Nov 2022 15:26:46 +0000 Subject: fix warnings --- Zotlabs/Lib/ThreadItem.php | 6 +-- Zotlabs/Module/Display.php | 95 +++++++++++++++++++++++----------------------- Zotlabs/Module/Update.php | 8 ++-- 3 files changed, 54 insertions(+), 55 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 472e2c6db..6ca952969 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -84,10 +84,8 @@ class ThreadItem { public function get_template_data($conv_responses, $thread_level=1, $conv_flags = []) { - $result = array(); - - $item = $this->get_data(); - + $result = []; + $item = $this->get_data(); $commentww = ''; $sparkle = ''; $buttons = ''; diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index 4e7c1587c..0aac96f4a 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -90,6 +90,7 @@ class Display extends \Zotlabs\Web\Controller { ); $o .= '
'; + $a = ''; $o .= status_editor($a,$x,false,'Display'); $o .= '
'; } @@ -307,71 +308,71 @@ class Display extends \Zotlabs\Web\Controller { $items = array(); } - switch($module_format) { - case 'html': + case 'html': - if ($update) { - $o .= conversation($items, 'display', $update, 'client'); - } - else { - $o .= ''; - App::$page['title'] = (($items[0]['title']) ? $items[0]['title'] . " - " . App::$page['title'] : App::$page['title']); + break; - $o .= conversation($items, 'display', $update, 'client'); - } + case 'atom': - break; + $atom = replace_macros(get_markup_template('atom_feed.tpl'), array( + '$version' => xmlify(\Zotlabs\Lib\System::get_project_version()), + '$generator' => xmlify(\Zotlabs\Lib\System::get_platform_name()), + '$generator_uri' => 'https://hubzilla.org', + '$feed_id' => xmlify(App::$cmd), + '$feed_title' => xmlify(t('Article')), + '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now', ATOM_TIME)), + '$author' => '', + '$owner' => '', + '$profile_page' => xmlify(z_root() . '/display/' . gen_link_id($target_item['mid'])), + )); - case 'atom': + $x = [ 'xml' => $atom, 'channel' => $channel, 'observer_hash' => $observer_hash, 'params' => $params ]; + call_hooks('atom_feed_top',$x); - $atom = replace_macros(get_markup_template('atom_feed.tpl'), array( - '$version' => xmlify(\Zotlabs\Lib\System::get_project_version()), - '$generator' => xmlify(\Zotlabs\Lib\System::get_platform_name()), - '$generator_uri' => 'https://hubzilla.org', - '$feed_id' => xmlify(App::$cmd), - '$feed_title' => xmlify(t('Article')), - '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now', ATOM_TIME)), - '$author' => '', - '$owner' => '', - '$profile_page' => xmlify(z_root() . '/display/' . gen_link_id($target_item['mid'])), - )); + $atom = $x['xml']; - $x = [ 'xml' => $atom, 'channel' => $channel, 'observer_hash' => $observer_hash, 'params' => $params ]; - call_hooks('atom_feed_top',$x); + // a much simpler interface + call_hooks('atom_feed', $atom); - $atom = $x['xml']; - // a much simpler interface - call_hooks('atom_feed', $atom); - - - if($items) { - $type = 'html'; - foreach($items as $item) { - if($item['item_private']) - continue; - $atom .= atom_entry($item, $type, null, '', true, '', false); + if($items) { + $type = 'html'; + foreach($items as $item) { + if($item['item_private']) + continue; + $atom .= atom_entry($item, $type, null, '', true, '', false); + } } - } - - call_hooks('atom_feed_end', $atom); - $atom .= '' . "\r\n"; + call_hooks('atom_feed_end', $atom); - header('Content-type: application/atom+xml'); - echo $atom; - killme(); + $atom .= '' . "\r\n"; + header('Content-type: application/atom+xml'); + echo $atom; + killme(); } $o .= '
'; diff --git a/Zotlabs/Module/Update.php b/Zotlabs/Module/Update.php index b3252f8b9..7a8db3469 100644 --- a/Zotlabs/Module/Update.php +++ b/Zotlabs/Module/Update.php @@ -5,8 +5,8 @@ namespace Zotlabs\Module; class Update extends \Zotlabs\Web\Controller { function get() { - - $profile_uid = intval($_GET['p']); + + $profile_uid = $_GET['p'] ?? 0; // it's probably safe to do this for all modules and not just a limited subset, // but it needs to be verified. @@ -23,7 +23,7 @@ class Update extends \Zotlabs\Web\Controller { if(in_array(strtolower(argv(1)),['articles','cards'])) killme(); - $module = "\\Zotlabs\\Module\\" . ucfirst(argv(1)); + $module = "\\Zotlabs\\Module\\" . ucfirst(argv(1)); $load = (((argc() > 2) && (argv(2) == 'load')) ? 1 : 0); $mod = new $module; @@ -38,6 +38,6 @@ class Update extends \Zotlabs\Web\Controller { echo "\r\n"; killme(); - + } } -- cgit v1.2.3