aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Search.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-10-20 19:25:01 +0000
committerMario <mario@mariovavti.com>2022-10-20 19:25:01 +0000
commit7ca289edd0d568a51dfdf225a5ef0e9663c38838 (patch)
tree5af544fa0ff7ca29fad5b57240a7ed2d66c5b2cf /Zotlabs/Module/Search.php
parentbf434818d7cfac6bf29482d4bb07fc567de2fc90 (diff)
downloadvolse-hubzilla-7ca289edd0d568a51dfdf225a5ef0e9663c38838.tar.gz
volse-hubzilla-7ca289edd0d568a51dfdf225a5ef0e9663c38838.tar.bz2
volse-hubzilla-7ca289edd0d568a51dfdf225a5ef0e9663c38838.zip
fix php warnings
Diffstat (limited to 'Zotlabs/Module/Search.php')
-rw-r--r--Zotlabs/Module/Search.php15
1 files changed, 5 insertions, 10 deletions
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 .= "<script> var profile_uid = " . ((intval(local_channel())) ? local_channel() : (-1))
. "; var netargs = '?f='; var profile_page = " . App::$pager['page'] . "; </script>\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 = [];