From 7ca289edd0d568a51dfdf225a5ef0e9663c38838 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 20 Oct 2022 19:25:01 +0000 Subject: fix php warnings --- Zotlabs/Module/Search.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'Zotlabs/Module/Search.php') diff --git a/Zotlabs/Module/Search.php b/Zotlabs/Module/Search.php index c88bc4534..6601da29d 100644 --- a/Zotlabs/Module/Search.php +++ b/Zotlabs/Module/Search.php @@ -146,10 +146,10 @@ class Search extends Controller { $o .= "\r\n"; - App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"), [ + App::$page['htmlhead'] = replace_macros(get_markup_template("build_query.tpl"), [ '$baseurl' => z_root(), '$pgtype' => 'search', - '$uid' => ((App::$profile['profile_uid']) ? App::$profile['profile_uid'] : '0'), + '$uid' => App::$profile['profile_uid'] ?? '0', '$gid' => '0', '$cid' => '0', '$cmin' => '(-1)', @@ -180,6 +180,8 @@ class Search extends Controller { } + $r = null; + if (($update) && ($load)) { $itemspage = get_pconfig(local_channel(), 'system', 'itemspage'); App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 10)); @@ -195,8 +197,6 @@ class Search extends Controller { $sys_id = perm_is_allowed($sys['channel_id'], $observer_hash, 'view_stream') ? $sys['channel_id'] : 0; if ($load) { - $r = null; - if (local_channel()) { $r = q("SELECT mid, MAX(id) AS item_id FROM item WHERE (( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = '' AND item.deny_gid = '' AND item.item_private = 0 ) @@ -208,7 +208,7 @@ class Search extends Controller { ); } - if (!$r) { + if ($r === null) { $r = q("SELECT mid, MAX(id) AS item_id FROM item WHERE (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = '' AND item.deny_gid = '' AND item.item_private = 0 ) AND item.uid IN ( " . stream_perms_api_uids(($observer_hash) ? (PERMS_NETWORK | PERMS_PUBLIC) : PERMS_PUBLIC) . " )) @@ -225,11 +225,6 @@ class Search extends Controller { $r = dbq("select *, id as item_id from item where id in ( " . $str . ") order by created desc"); } } - else { - $r = []; - } - - } $items = []; -- cgit v1.2.3