From 71accb6b0a2aa5e3c77f7ef73d685639d0c6526a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 13 Oct 2022 16:38:18 +0200 Subject: fix php warnings --- Zotlabs/Module/Help.php | 9 +++++---- Zotlabs/Module/Pubstream.php | 20 +++++++++----------- Zotlabs/Module/Sslify.php | 18 +++++++++++------- 3 files changed, 25 insertions(+), 22 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Help.php b/Zotlabs/Module/Help.php index ce05035b3..bfe1d4e12 100644 --- a/Zotlabs/Module/Help.php +++ b/Zotlabs/Module/Help.php @@ -17,7 +17,7 @@ class Help extends \Zotlabs\Web\Controller { function get() { nav_set_selected('Help'); - if($_REQUEST['search']) { + if(isset($_REQUEST['search']) && $_REQUEST['search']) { $o .= '
'; $o .= '
'; $o .= '

' . t('Documentation Search') . ' - ' . htmlspecialchars($_REQUEST['search']) . '

'; @@ -44,8 +44,8 @@ class Help extends \Zotlabs\Web\Controller { return $o; } - - + + if(argc() > 2 && argv(argc()-2) === 'assets') { $path = ''; for($x = 1; $x < argc(); $x ++) { @@ -87,11 +87,12 @@ class Help extends \Zotlabs\Web\Controller { 'tutorials' => t('Tutorials') ]; + $heading = ''; if(array_key_exists(argv(1), $headings)) $heading = $headings[argv(1)]; $content = get_help_content(); - + $language = determine_help_language()['language']; return replace_macros(get_markup_template('help.tpl'), array( diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php index 583974e22..1eb0e2142 100644 --- a/Zotlabs/Module/Pubstream.php +++ b/Zotlabs/Module/Pubstream.php @@ -75,7 +75,7 @@ class Pubstream extends \Zotlabs\Web\Controller { 'allow_location' => ((intval(get_pconfig($channel['channel_id'],'system','use_browser_location'))) ? '1' : ''), 'default_location' => $channel['channel_location'], 'nickname' => $channel['channel_address'], - 'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), + 'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), 'acl' => populate_acl($channel_acl,true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post'), 'permissions' => $channel_acl, 'bang' => '', @@ -91,6 +91,7 @@ class Pubstream extends \Zotlabs\Web\Controller { ); $o .= '
'; + $a = ''; $o .= status_editor($a,$x,false,'Pubstream'); $o .= '
'; } @@ -181,14 +182,14 @@ class Pubstream extends \Zotlabs\Web\Controller { $net_query = (($net) ? " left join xchan on xchan_hash = author_xchan " : ''); $net_query2 = (($net) ? " and xchan_network = '" . protect_sprintf(dbesc($net)) . "' " : ''); - $abook_uids = " and abook.abook_channel = " . intval(\App::$profile['profile_uid']) . " "; - $simple_update = ''; if($update && $_SESSION['loadtime']) $simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) "; //logger('update: ' . $update . ' load: ' . $load); + $items = []; + if($update) { $ordering = get_config('system', 'pubstream_ordering', 'commented'); @@ -200,18 +201,18 @@ class Pubstream extends \Zotlabs\Web\Controller { $net_query WHERE mid = '%s' $uids $item_normal and (abook.abook_blocked = 0 or abook.abook_flags is null) - $sql_extra3 $sql_extra $sql_nets $net_query2", + $sql_extra $net_query2", dbesc($mid) ); } else { // Fetch a page full of parent items for this page $r = dbq("SELECT item.id AS item_id FROM item - left join abook on ( item.author_xchan = abook.abook_xchan $abook_uids ) + left join abook on ( item.author_xchan = abook.abook_xchan ) $net_query WHERE true $uids and item.item_thread_top = 1 $item_normal and (abook.abook_blocked = 0 or abook.abook_flags is null) - $sql_extra3 $sql_extra $sql_nets $net_query2 + $sql_extra $net_query2 ORDER BY $ordering DESC $pager_sql " ); } @@ -223,7 +224,7 @@ class Pubstream extends \Zotlabs\Web\Controller { $net_query WHERE mid = '%s' $uids $item_normal_update $simple_update and (abook.abook_blocked = 0 or abook.abook_flags is null) - $sql_extra3 $sql_extra $sql_nets $net_query2", + $sql_extra $net_query2", dbesc($mid) ); } @@ -234,7 +235,7 @@ class Pubstream extends \Zotlabs\Web\Controller { WHERE true $uids $item_normal_update $simple_update and (abook.abook_blocked = 0 or abook.abook_flags is null) - $sql_extra3 $sql_extra $sql_nets $net_query2" + $sql_extra $net_query2" ); } } @@ -259,9 +260,6 @@ class Pubstream extends \Zotlabs\Web\Controller { $items = fetch_post_tags($items,true); $items = conv_sort($items,$ordering); } - else { - $items = array(); - } } diff --git a/Zotlabs/Module/Sslify.php b/Zotlabs/Module/Sslify.php index 37be4423b..9dd5c4a0b 100644 --- a/Zotlabs/Module/Sslify.php +++ b/Zotlabs/Module/Sslify.php @@ -9,23 +9,27 @@ class Sslify extends \Zotlabs\Web\Controller { if($x['success']) { $h = explode("\n",$x['header']); foreach ($h as $l) { + if (strpos($l, ':') === false) { + continue; + } + list($k,$v) = array_map("trim", explode(":", trim($l), 2)); $hdrs[strtolower($k)] = $v; } - - if (array_key_exists('content-type', $hdrs)) + + if (array_key_exists('content-type', $hdrs)) header('Content-Type: ' . $hdrs['content-type']); - if (array_key_exists('last-modified', $hdrs)) + if (array_key_exists('last-modified', $hdrs)) header('Last-Modified: ' . $hdrs['last-modified']); - if (array_key_exists('cache-control', $hdrs)) + if (array_key_exists('cache-control', $hdrs)) header('Cache-Control: ' . $hdrs['cache-control']); - if (array_key_exists('expires', $hdrs)) + if (array_key_exists('expires', $hdrs)) header('Expires: ' . $hdrs['expires']); - + echo $x['body']; killme(); } killme(); - } + } } -- cgit v1.2.3