diff options
author | Mario <mario@mariovavti.com> | 2022-10-20 19:25:01 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-10-20 19:25:01 +0000 |
commit | 7ca289edd0d568a51dfdf225a5ef0e9663c38838 (patch) | |
tree | 5af544fa0ff7ca29fad5b57240a7ed2d66c5b2cf | |
parent | bf434818d7cfac6bf29482d4bb07fc567de2fc90 (diff) | |
download | volse-hubzilla-7ca289edd0d568a51dfdf225a5ef0e9663c38838.tar.gz volse-hubzilla-7ca289edd0d568a51dfdf225a5ef0e9663c38838.tar.bz2 volse-hubzilla-7ca289edd0d568a51dfdf225a5ef0e9663c38838.zip |
fix php warnings
-rw-r--r-- | Zotlabs/Daemon/Notifier.php | 8 | ||||
-rw-r--r-- | Zotlabs/Lib/XConfig.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Directory.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Rpost.php | 10 | ||||
-rw-r--r-- | Zotlabs/Module/Search.php | 15 | ||||
-rw-r--r-- | include/photo/photo_driver.php | 1 | ||||
-rw-r--r-- | include/taxonomy.php | 2 | ||||
-rw-r--r-- | include/text.php | 2 |
8 files changed, 20 insertions, 22 deletions
diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 776cf4f63..f9e1d13d5 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -113,8 +113,8 @@ class Notifier { $normal_mode = true; $upstream = false; $uplink = false; - $target_item = []; - $parent_item = []; + $target_item = null; + $parent_item = null; $top_level_post = false; $relay_to_owner = false; @@ -651,7 +651,7 @@ class Notifier { // This shouldn't produce false positives on comment boosts that were generated on other platforms // because we won't be delivering them. - if (isset($target_item) && isset($target_item['verb']) && $target_item['verb'] === 'Announce' && $target_item['author_xchan'] === $target_item['owner_xchan'] && ! intval($target_item['item_thread_top'])) { + if (isset($target_item['verb']) && $target_item['verb'] === 'Announce' && $target_item['author_xchan'] === $target_item['owner_xchan'] && ! intval($target_item['item_thread_top'])) { continue; } @@ -694,7 +694,7 @@ class Notifier { } - if ($normal_mode) { + if ($normal_mode && is_array($target_item)) { // This wastes a process if there are no delivery hooks configured, so check this before launching the new process $x = q("select * from hook where hook = 'notifier_normal'"); if ($x) { diff --git a/Zotlabs/Lib/XConfig.php b/Zotlabs/Lib/XConfig.php index c5a108ac9..76ac8dc7a 100644 --- a/Zotlabs/Lib/XConfig.php +++ b/Zotlabs/Lib/XConfig.php @@ -162,7 +162,7 @@ class XConfig { */ static public function Delete($xchan, $family, $key) { - if(x(\App::$config[$xchan][$family], $key)) + if(isset(\App::$config[$xchan][$family][$key])) unset(\App::$config[$xchan][$family][$key]); $ret = q("DELETE FROM xconfig WHERE xchan = '%s' AND cat = '%s' AND k = '%s'", 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 = []; diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 14408ea50..0b691b457 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -77,6 +77,7 @@ function guess_image_type($filename, $data = '') { $type = null; $m = null; + $headers = ''; $ph = photo_factory(''); $types = $ph->supportedTypes(); diff --git a/include/taxonomy.php b/include/taxonomy.php index 88be43464..1eded055a 100644 --- a/include/taxonomy.php +++ b/include/taxonomy.php @@ -555,7 +555,7 @@ function dir_tagblock($link,$r) { $o = ''; if(! $r) - $r = App::$data['directory_keywords']; + $r = App::$data['directory_keywords'] ?? []; if($r) { $o = '<div class="dirtagblock widget"><h3>' . t('Keywords') . '</h3><div class="tags" align="center">'; diff --git a/include/text.php b/include/text.php index 220844fd1..d0092912b 100644 --- a/include/text.php +++ b/include/text.php @@ -2206,6 +2206,8 @@ function mimetype_select($channel_id, $current = 'text/bbcode', $choices = null, $x['application/x-php'] = t('PHP'); } + $options = ''; + foreach($x as $y => $z) { $selected = (($y == $current) ? ' selected="selected" ' : ''); $options .= '<option value="' . $y . '"' . $selected . '>' . $z . '</option>'; |