diff options
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Directory.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Rpost.php | 10 | ||||
-rw-r--r-- | Zotlabs/Module/Search.php | 15 |
3 files changed, 11 insertions, 16 deletions
diff --git a/Zotlabs/Module/Directory.php b/Zotlabs/Module/Directory.php index c543503e4..8995f709c 100644 --- a/Zotlabs/Module/Directory.php +++ b/Zotlabs/Module/Directory.php @@ -396,7 +396,7 @@ class Directory extends Controller { ksort($entries); // Sort array by key so that foreach-constructs work as expected - if($j['keywords']) { + if(isset($j['keywords']) && $j['keywords']) { App::$data['directory_keywords'] = $j['keywords']; } diff --git a/Zotlabs/Module/Rpost.php b/Zotlabs/Module/Rpost.php index 013817597..534f29b7b 100644 --- a/Zotlabs/Module/Rpost.php +++ b/Zotlabs/Module/Rpost.php @@ -151,7 +151,7 @@ class Rpost extends \Zotlabs\Web\Controller { } } - if($_REQUEST['remote_return']) { + if(isset($_REQUEST['remote_return']) && $_REQUEST['remote_return']) { $_SESSION['remote_return'] = $_REQUEST['remote_return']; } if(argc() > 1 && argv(1) === 'return') { @@ -162,14 +162,14 @@ class Rpost extends \Zotlabs\Web\Controller { $plaintext = true; - if(array_key_exists('type', $_REQUEST) && $_REQUEST['type'] === 'html') { + if(isset($_REQUEST['type']) && $_REQUEST['type'] === 'html') { require_once('include/html2bbcode.php'); $_REQUEST['body'] = html2bbcode($_REQUEST['body']); } $channel = \App::get_channel(); - if($_REQUEST['acl']) { + if(isset($_REQUEST['acl']) && $_REQUEST['acl']) { $acl = new \Zotlabs\Access\AccessList([]); $acl->set($_REQUEST['acl']); $channel_acl = $acl->get(); @@ -180,13 +180,13 @@ class Rpost extends \Zotlabs\Web\Controller { } - if($_REQUEST['url']) { + if(isset($_REQUEST['url']) && $_REQUEST['url']) { $x = z_fetch_url(z_root() . '/linkinfo?f=&url=' . urlencode($_REQUEST['url'])); if($x['success']) $_REQUEST['body'] = $_REQUEST['body'] . $x['body']; } - if($_REQUEST['post_id']) { + if(isset($_REQUEST['post_id']) && $_REQUEST['post_id']) { $_REQUEST['body'] .= '[share=' . intval($_REQUEST['post_id']) . '][/share]'; } 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 = []; |