diff options
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Acl.php | 14 | ||||
-rw-r--r-- | Zotlabs/Module/Admin/Queue.php | 9 | ||||
-rw-r--r-- | Zotlabs/Module/Channel.php | 3 | ||||
-rw-r--r-- | Zotlabs/Module/Contactedit.php | 6 | ||||
-rw-r--r-- | Zotlabs/Module/Home.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Hq.php | 19 | ||||
-rw-r--r-- | Zotlabs/Module/Import_progress.php | 7 | ||||
-rw-r--r-- | Zotlabs/Module/Item.php | 4 | ||||
-rw-r--r-- | Zotlabs/Module/Network.php | 8 | ||||
-rw-r--r-- | Zotlabs/Module/Outbox.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Owa.php | 39 | ||||
-rw-r--r-- | Zotlabs/Module/Poke.php | 31 | ||||
-rw-r--r-- | Zotlabs/Module/Rmagic.php | 54 | ||||
-rw-r--r-- | Zotlabs/Module/Search.php | 15 | ||||
-rw-r--r-- | Zotlabs/Module/Siteinfo.php | 12 | ||||
-rw-r--r-- | Zotlabs/Module/Sse_bs.php | 8 | ||||
-rw-r--r-- | Zotlabs/Module/Wfinger.php | 2 |
17 files changed, 120 insertions, 115 deletions
diff --git a/Zotlabs/Module/Acl.php b/Zotlabs/Module/Acl.php index 5b37f2707..9dc422e6b 100644 --- a/Zotlabs/Module/Acl.php +++ b/Zotlabs/Module/Acl.php @@ -66,6 +66,11 @@ class Acl extends \Zotlabs\Web\Controller { killme(); $permitted = []; + $sql_extra = ''; + $sql_extra2 = ''; + $sql_extra3 = ''; + $sql_extra2_xchan = ''; + $order_extra2 = ''; if(in_array($type, [ 'm', 'a', 'c', 'f' ])) { @@ -81,7 +86,6 @@ class Acl extends \Zotlabs\Web\Controller { } - if($search) { $sql_extra = " AND pgrp.gname LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " "; $sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc(punify($search)) . ((strpos($search,'@') === false) ? "%@%'" : "%'")) . ") "; @@ -100,10 +104,6 @@ class Acl extends \Zotlabs\Web\Controller { $sql_extra3 = "AND ( xchan_addr like " . protect_sprintf( "'%" . dbesc(punify($search)) . "%'" ) . " OR xchan_name like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ) "; } - else { - $sql_extra = $sql_extra2 = $sql_extra3 = ""; - } - $groups = array(); $contacts = array(); @@ -342,7 +342,7 @@ class Acl extends \Zotlabs\Web\Controller { $x = []; foreach($r as $g) { - if(in_array($g['net'],['rss','anon','unknown']) && ($type != 'a')) + if(isset($g['net']) && in_array($g['net'], ['rss','anon','unknown']) && ($type != 'a')) continue; $g['hash'] = urlencode($g['hash']); @@ -383,7 +383,7 @@ class Acl extends \Zotlabs\Web\Controller { "self" => (intval($g['abook_self']) ? 'abook-self' : ''), "taggable" => '', "label" => '', - "net" => $g['net'] + "net" => $g['net'] ?? '' ); } } diff --git a/Zotlabs/Module/Admin/Queue.php b/Zotlabs/Module/Admin/Queue.php index 8a843083b..8a20324d0 100644 --- a/Zotlabs/Module/Admin/Queue.php +++ b/Zotlabs/Module/Admin/Queue.php @@ -12,18 +12,18 @@ class Queue { $o = ''; - $expert = ((array_key_exists('expert',$_REQUEST)) ? intval($_REQUEST['expert']) : 0); + $expert = $_REQUEST['expert'] ?? false; - if($_REQUEST['drophub']) { + if(isset($_REQUEST['drophub'])) { hubloc_mark_as_down($_REQUEST['drophub']); LibQueue::remove_by_posturl($_REQUEST['drophub']); } - if($_REQUEST['emptyhub']) { + if(isset($_REQUEST['emptyhub'])) { LibQueue::remove_by_posturl($_REQUEST['emptyhub']); } - if($_REQUEST['deliverhub']) { + if(isset($_REQUEST['deliverhub'])) { $hubq = q("SELECT * FROM outq WHERE outq_posturl = '%s'", dbesc($_REQUEST['deliverhub']) @@ -39,7 +39,6 @@ class Queue { for($x = 0; $x < count($r); $x ++) { $r[$x]['eurl'] = urlencode($r[$x]['outq_posturl']); - $r[$x]['connected'] = datetime_convert('UTC',date_default_timezone_get(),$r[$x]['connected'],'Y-m-d'); } $o = replace_macros(get_markup_template('admin_queue.tpl'), array( diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index aebc70c15..24a3fd44f 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -67,7 +67,7 @@ class Channel extends Controller { if ($sigdata && $sigdata['signer'] && $sigdata['header_valid']) { $data = json_encode(Libzot::zotinfo(['guid_hash' => $channel['channel_hash'], 'target_url' => $sigdata['signer']])); - $s = q("select site_crypto, hubloc_sitekey from site left join hubloc on hubloc_url = site_url where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", + $s = q("select site_crypto, hubloc_sitekey from site left join hubloc on hubloc_url = site_url where hubloc_id_url = '%s' and hubloc_network = 'zot6' order by hubloc_id desc limit 1", dbesc($sigdata['signer']) ); @@ -267,6 +267,7 @@ class Channel extends Controller { 'reset' => t('Reset form') ]; + $a = ''; $o .= status_editor($a, $x, false, 'Channel'); } diff --git a/Zotlabs/Module/Contactedit.php b/Zotlabs/Module/Contactedit.php index d306039d2..58c3380a1 100644 --- a/Zotlabs/Module/Contactedit.php +++ b/Zotlabs/Module/Contactedit.php @@ -103,7 +103,7 @@ class Contactedit extends Controller { dbesc($profile_id), intval(local_channel()) ); - if (!count($r)) { + if (!$r) { notice(t('Could not locate selected profile.') . EOL); return; } @@ -452,8 +452,8 @@ class Contactedit extends Controller { if (is_ajax()) { json_return_and_die([ - 'success' => ((intval($_REQUEST['success'])) ? intval($_REQUEST['success']) : 1), - 'message' => (($_REQUEST['success']) ? t('Contact updated') : t('Contact update failed')), + 'success' => ((isset($_REQUEST['success'])) ? intval($_REQUEST['success']) : 1), + 'message' => ((isset($_REQUEST['success'])) ? t('Contact updated') : t('Contact update failed')), 'id' => $contact_id, 'title' => $header_html, 'role' => ((intval($contact['abook_pending'])) ? '' : $roles_dict[$current_permcat]), diff --git a/Zotlabs/Module/Home.php b/Zotlabs/Module/Home.php index 315d05af6..8d78960cc 100644 --- a/Zotlabs/Module/Home.php +++ b/Zotlabs/Module/Home.php @@ -36,7 +36,7 @@ class Home extends Controller { $channel = App::get_channel(); if (local_channel() && $channel && $channel['xchan_url'] && !$splash) { - $dest = (($ret['startpage']) ? $ret['startpage'] : ''); + $dest = $ret['startpage'] ?? ''; if (!$dest) $dest = get_config('system', 'startpage'); if (!$dest) diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php index efbfcf084..cd95ac4b0 100644 --- a/Zotlabs/Module/Hq.php +++ b/Zotlabs/Module/Hq.php @@ -47,24 +47,11 @@ class Hq extends \Zotlabs\Web\Controller { $sys = get_sys_channel(); $sys_item = false; $sql_extra = ''; - - if(! $item_hash) { - //$r = q("SELECT mid FROM item - //WHERE uid = %d $item_normal - //AND mid = parent_mid - //AND item_private IN (0, 1) - //ORDER BY created DESC LIMIT 1", - //intval(local_channel()) - //); - //if($r[0]['mid']) { - //$item_hash = $r[0]['mid']; - //} - } + $target_item = null; + $o = ''; if($item_hash) { - $target_item = null; - $r = q("select id, uid, mid, parent_mid, thr_parent, verb, item_type, item_deleted, item_blocked from item where mid = '%s' limit 1", dbesc($item_hash) ); @@ -115,7 +102,7 @@ class Hq extends \Zotlabs\Web\Controller { ]; $a = ''; - $o = status_editor($a, $x, true); + $o .= status_editor($a, $x, true); } diff --git a/Zotlabs/Module/Import_progress.php b/Zotlabs/Module/Import_progress.php index 761d2f215..5c68f9ff1 100644 --- a/Zotlabs/Module/Import_progress.php +++ b/Zotlabs/Module/Import_progress.php @@ -49,11 +49,6 @@ class Import_progress extends \Zotlabs\Web\Controller { } $ccompleted_str = t('Item sync completed but no items were found!'); - - if(argv(1) === 'resume_itemsync') { - Master::Summon(["Content_importer","0","0001-01-01 00:00:00","2021-10-02 19:49:14","ct5","https%3A%2F%2Fhub.somaton.com"]); - goaway('/import_progress'); - } } $cprogress_str = ((intval($cprogress)) ? $cprogress . '%' : $cprogress); @@ -76,8 +71,6 @@ class Import_progress extends \Zotlabs\Web\Controller { Master::Summon($f['next_cmd']); goaway('/import_progress'); } - - } else { $fprogress = 'waiting to start...'; diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index e1ba2b2f0..588391843 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -387,7 +387,7 @@ class Item extends Controller { $categories = ((x($_REQUEST, 'category')) ? escape_tags($_REQUEST['category']) : ''); $webpage = ((x($_REQUEST, 'webpage')) ? intval($_REQUEST['webpage']) : 0); $item_obscured = ((x($_REQUEST, 'obscured')) ? intval($_REQUEST['obscured']) : 0); - $pagetitle = ((x($_REQUEST, 'pagetitle')) ? escape_tags(urlencode($_REQUEST['pagetitle'])) : ''); + $pagetitle = ((x($_REQUEST, 'pagetitle')) ? escape_tags($_REQUEST['pagetitle']) : ''); $layout_mid = ((x($_REQUEST, 'layout_mid')) ? escape_tags($_REQUEST['layout_mid']) : ''); $plink = ((x($_REQUEST, 'permalink')) ? escape_tags($_REQUEST['permalink']) : ''); $obj_type = ((x($_REQUEST, 'obj_type')) ? escape_tags($_REQUEST['obj_type']) : ACTIVITY_OBJ_NOTE); @@ -411,7 +411,7 @@ class Item extends Controller { } if ($pagetitle) { - $pagetitle = strtolower(URLify::transliterate($pagetitle)); + $pagetitle = str_replace('/', '-', strtolower(URLify::transliterate($pagetitle))); } diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index f4f6cc8d1..00fed55c2 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -129,6 +129,9 @@ class Network extends \Zotlabs\Web\Controller { $pf = ((x($_GET, 'pf')) ? $_GET['pf'] : ''); $unseen = ((x($_GET, 'unseen')) ? $_GET['unseen'] : ''); + $status_editor = ''; + + if (Apps::system_app_installed(local_channel(), 'Affinity Tool')) { $affinity_locked = intval(get_pconfig(local_channel(), 'affinity', 'lock', 1)); if ($affinity_locked) { @@ -208,6 +211,7 @@ class Network extends \Zotlabs\Web\Controller { 'reset' => t('Reset form') ); + $a = ''; $status_editor = status_editor($a, $x, false, 'Network'); $o .= $status_editor; @@ -370,9 +374,9 @@ class Network extends \Zotlabs\Web\Controller { // ActivityStreams specification. if (substr($verb, 0, 1) === '.') { - $verb = substr($verb, 1); + $sql_verb = substr($verb, 1); $sql_extra .= sprintf(" AND item.obj_type like '%s' ", - dbesc(protect_sprintf('%' . $verb . '%')) + dbesc(protect_sprintf('%' . $sql_verb . '%')) ); } else { diff --git a/Zotlabs/Module/Outbox.php b/Zotlabs/Module/Outbox.php index 503b464d1..24a3399a5 100644 --- a/Zotlabs/Module/Outbox.php +++ b/Zotlabs/Module/Outbox.php @@ -76,7 +76,7 @@ class Outbox extends Controller { App::set_pager_itemspage(30); } - if (App::$pager['unset'] && $total > 30) { + if (isset(App::$pager['unset']) && $total > 30) { $ret = Activity::paged_collection_init($total, App::$query_string); } else { diff --git a/Zotlabs/Module/Owa.php b/Zotlabs/Module/Owa.php index e30aa5fb4..0922eb5d4 100644 --- a/Zotlabs/Module/Owa.php +++ b/Zotlabs/Module/Owa.php @@ -32,14 +32,14 @@ class Owa extends Controller { $keyId = $sigblock['keyId']; if ($keyId) { $r = q("SELECT * FROM hubloc LEFT JOIN xchan ON hubloc_hash = xchan_hash - WHERE hubloc_id_url = '%s' AND xchan_pubkey != '' ", + WHERE hubloc_id_url = '%s' AND hubloc_deleted = 0 ORDER BY hubloc_id DESC", dbesc($keyId) ); if (! $r) { - $found = discover_by_webbie(str_replace('acct:','',$keyId)); + $found = discover_by_webbie($keyId); if ($found) { $r = q("SELECT * FROM hubloc LEFT JOIN xchan ON hubloc_hash = xchan_hash - WHERE hubloc_id_url = '%s' AND xchan_pubkey != '' ", + WHERE hubloc_id_url = '%s' AND hubloc_deleted = 0 ORDER BY hubloc_id DESC ", dbesc($keyId) ); } @@ -61,10 +61,43 @@ class Owa extends Controller { logger('OWA fail: ' . $hubloc['hubloc_id'] . ' ' . $hubloc['hubloc_id_url']); } } + + if (!$ret['success']) { + + // Possible a reinstall? + // In this case we probably already have an old hubloc + // but not the new one yet. + + $found = discover_by_webbie($keyId); + + if ($found) { + $r = q("SELECT * FROM hubloc LEFT JOIN xchan ON hubloc_hash = xchan_hash + WHERE hubloc_id_url = '%s' AND hubloc_deleted = 0 ORDER BY hubloc_id DESC LIMIT 1", + dbesc($keyId) + ); + + if ($r) { + $verified = HTTPSig::verify(file_get_contents('php://input'), $r[0]['xchan_pubkey']); + if ($verified && $verified['header_signed'] && $verified['header_valid'] && ($verified['content_valid'] || (! $verified['content_signed']))) { + logger('OWA header: ' . print_r($verified,true), LOGGER_DATA); + logger('OWA success: ' . $r[0]['hubloc_id_url'], LOGGER_DATA); + $ret['success'] = true; + $token = random_string(32); + Verify::create('owt', 0, $token, $r[0]['hubloc_id_url']); + $result = ''; + openssl_public_encrypt($token, $result, $r[0]['xchan_pubkey']); + $ret['encrypted_token'] = base64url_encode($result); + } else { + logger('OWA fail: ' . $hubloc['hubloc_id'] . ' ' . $hubloc['hubloc_id_url']); + } + } + } + } } } } } + json_return_and_die($ret,'application/x-zot+json'); } } diff --git a/Zotlabs/Module/Poke.php b/Zotlabs/Module/Poke.php index d60a7f426..596de58a3 100644 --- a/Zotlabs/Module/Poke.php +++ b/Zotlabs/Module/Poke.php @@ -3,6 +3,7 @@ namespace Zotlabs\Module; /** @file */ use App; use Zotlabs\Lib\Apps; +use Zotlabs\Lib\Activity; use Zotlabs\Web\Controller; /** @@ -107,11 +108,6 @@ class Poke extends Controller { $deny_gid = (($item_private) ? '' : $channel['channel_deny_gid']); } - - $arr = array(); - - - $arr['item_wall'] = 1; $arr['owner_xchan'] = (($parent_item) ? $parent_item['owner_xchan'] : $channel['channel_hash']); $arr['parent_mid'] = (($parent_mid) ? $parent_mid : ''); @@ -122,26 +118,15 @@ class Poke extends Controller { $arr['deny_gid'] = $deny_gid; $arr['verb'] = $activity; $arr['item_private'] = $item_private; - $arr['obj_type'] = ACTIVITY_OBJ_PERSON; + $arr['obj_type'] = ACTIVITY_OBJ_NOTE; $arr['body'] = '[zrl=' . $channel['xchan_url'] . ']' . $channel['xchan_name'] . '[/zrl]' . ' ' . t($verbs[$verb][0]) . ' ' . '[zrl=' . $target['xchan_url'] . ']' . $target['xchan_name'] . '[/zrl]'; - - $obj = array( - 'type' => ACTIVITY_OBJ_PERSON, - 'title' => $target['xchan_name'], - 'id' => $target['xchan_hash'], - 'link' => array( - array('rel' => 'alternate', 'type' => 'text/html', 'href' => $target['xchan_url']), - array('rel' => 'photo', 'type' => $target['xchan_photo_mimetype'], 'href' => $target['xchan_photo_l']) - ), - ); - - $arr['obj'] = json_encode($obj); - $arr['item_origin'] = 1; $arr['item_wall'] = 1; $arr['item_unseen'] = 1; if(! $parent_item) - $item['item_thread_top'] = 1; + $arr['item_thread_top'] = 1; + + $arr['obj'] = Activity::encode_item($arr); post_activity_item($arr); @@ -198,8 +183,8 @@ class Poke extends Controller { $desc = t('Poke somebody'); } else { - $title = t('Poke/Prod'); - $desc = t('Poke, prod or do other things to somebody'); + $title = t('Poke'); + $desc = t('Poke or ping somebody'); } $o = replace_macros(get_markup_template('poke_content.tpl'),array( @@ -207,7 +192,7 @@ class Poke extends Controller { '$poke_basic' => $poke_basic, '$desc' => $desc, '$clabel' => t('Recipient'), - '$choice' => t('Choose what you wish to do to recipient'), + '$choice' => t('Choose action'), '$verbs' => $shortlist, '$parent' => $parent, '$prv_desc' => t('Make this post private'), diff --git a/Zotlabs/Module/Rmagic.php b/Zotlabs/Module/Rmagic.php index ab9ad059e..2950dca5e 100644 --- a/Zotlabs/Module/Rmagic.php +++ b/Zotlabs/Module/Rmagic.php @@ -6,21 +6,21 @@ use Zotlabs\Lib\Libzot; class Rmagic extends \Zotlabs\Web\Controller { function init() { - + if(local_channel()) goaway(z_root()); - + $me = get_my_address(); if($me) { - $r = q("select hubloc_url from hubloc where hubloc_addr = '%s'", + $r = q("select hubloc_url, hubloc_network from hubloc where hubloc_addr = '%s' and hubloc_deleted = 0", dbesc($me) - ); + ); if(! $r) { $w = discover_by_webbie($me); if($w) { - $r = q("select hubloc_url from hubloc where hubloc_addr = '%s'", + $r = q("select hubloc_url, hubloc_network from hubloc where hubloc_addr = '%s' and hubloc_deleted = 0", dbesc($me) - ); + ); } } @@ -33,39 +33,39 @@ class Rmagic extends \Zotlabs\Web\Controller { } } } - + function post() { - + $address = trim($_REQUEST['address']); - + if(strpos($address,'@') === false) { $arr = array('address' => $address); - call_hooks('reverse_magic_auth', $arr); - + call_hooks('reverse_magic_auth', $arr); + // if they're still here... - notice( t('Authentication failed.') . EOL); + notice( t('Authentication failed.') . EOL); return; } else { - + // Presumed Red identity. Perform reverse magic auth - + if(strpos($address,'@') === false) { notice('Invalid address.'); return; } - + $r = null; if($address) { - $r = q("select hubloc_url from hubloc where hubloc_addr = '%s'", + $r = q("select hubloc_url, hubloc_network from hubloc where hubloc_addr = '%s' and hubloc_deleted = 0", dbesc($address) - ); + ); if(! $r) { $w = discover_by_webbie($address); if($w) { - $r = q("select hubloc_url from hubloc where hubloc_addr = '%s'", + $r = q("select hubloc_url, hubloc_network from hubloc where hubloc_addr = '%s' and hubloc_deleted = 0", dbesc($address) - ); + ); } } } @@ -76,20 +76,20 @@ class Rmagic extends \Zotlabs\Web\Controller { } else { $url = 'https://' . substr($address,strpos($address,'@')+1); - } - - if($url) { - if($_SESSION['return_url']) + } + + if($url) { + if($_SESSION['return_url']) $dest = bin2hex(z_root() . '/' . str_replace('zid=','zid_=',$_SESSION['return_url'])); else $dest = bin2hex(z_root() . '/' . str_replace([ 'rmagic', 'zid=' ] ,[ '', 'zid_='],\App::$query_string)); - + goaway($url . '/magic' . '?f=&owa=1&bdest=' . $dest); } } } - - + + function get() { return replace_macros(get_markup_template('rmagic.tpl'), [ @@ -97,6 +97,6 @@ class Rmagic extends \Zotlabs\Web\Controller { '$address' => [ 'address', t('Enter your channel address (e.g. channel@example.com)'), '', '' ], '$submit' => t('Authenticate') ] - ); + ); } } diff --git a/Zotlabs/Module/Search.php b/Zotlabs/Module/Search.php index efea7bbdd..da4752186 100644 --- a/Zotlabs/Module/Search.php +++ b/Zotlabs/Module/Search.php @@ -59,15 +59,18 @@ class Search extends Controller { $o .= search($search, 'search-box', '/search', ((local_channel()) ? true : false)); if (local_channel() && strpos($search, 'https://') === 0 && !$update && !$load) { - if (strpos($search, 'b64.') !== false) { - if (strpos($search, '?') !== false) { - $search = strtok($search, '?'); + + $url = htmlspecialchars_decode($search); + + if (strpos($url, 'b64.') !== false) { + if (strpos($url, '?') !== false) { + $url = strtok($url, '?'); } - $search = unpack_link_id(basename($search)); + $url = unpack_link_id(basename($url)); } - $f = Libzot::fetch_conversation(App::get_channel(), punify($search), true); + $f = Libzot::fetch_conversation(App::get_channel(), punify($url), true); if ($f) { $mid = $f[0]['message_id']; @@ -83,7 +86,7 @@ class Search extends Controller { else { // try other fetch providers (e.g. diaspora, pubcrawl) $hookdata = [ - 'url' => punify($search) + 'url' => punify($url) ]; call_hooks('fetch_provider', $hookdata); } diff --git a/Zotlabs/Module/Siteinfo.php b/Zotlabs/Module/Siteinfo.php index a8c5bda91..be6862c6b 100644 --- a/Zotlabs/Module/Siteinfo.php +++ b/Zotlabs/Module/Siteinfo.php @@ -10,14 +10,14 @@ class Siteinfo extends \Zotlabs\Web\Controller { json_return_and_die($data); } } - + function get() { $federated = []; call_hooks('federated_transports',$federated); - + $siteinfo = replace_macros(get_markup_template('siteinfo.tpl'), - [ + [ '$title' => t('About this site'), '$sitenametxt' => t('Site Name'), '$sitename' => \Zotlabs\Lib\System::get_site_name(), @@ -29,7 +29,7 @@ class Siteinfo extends \Zotlabs\Web\Controller { '$prj_header' => t('Software and Project information'), '$prj_name' => t('This site is powered by $Projectname'), '$prj_transport' => t('Federated and decentralised networking and identity services provided by Zot'), - '$transport_link' => '<a href="https://zotlabs.com">https://zotlabs.com</a>', + '$transport_link' => '<a href="https://zotlabs.org">https://zotlabs.org</a>', '$additional_text' => t('Additional federated transport protocols:'), '$additional_fed' => implode(', ', $federated), @@ -41,11 +41,11 @@ class Siteinfo extends \Zotlabs\Web\Controller { ] ); - call_hooks('about_hook', $siteinfo); + call_hooks('about_hook', $siteinfo); return $siteinfo; } - + } diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php index ad9be0938..3a4e4e09e 100644 --- a/Zotlabs/Module/Sse_bs.php +++ b/Zotlabs/Module/Sse_bs.php @@ -41,7 +41,7 @@ class Sse_bs extends Controller { self::$offset = 0; self::$xchans = ''; - if($_REQUEST['sse_rmids']) + if(isset($_REQUEST['sse_rmids'])) self::mark_read($_REQUEST['sse_rmids']); if(!empty($_REQUEST['nquery']) && $_REQUEST['nquery'] !== '%') { @@ -580,12 +580,12 @@ class Sse_bs extends Controller { $forums[$x]['notify_link'] = z_root() . '/network/?f=&pf=1&unseen=1&cid=' . $forums[$x]['abook_id']; $forums[$x]['name'] = $forums[$x]['xchan_name']; - $forums[$x]['addr'] = $forums[$x]['xchan_addr']; + $forums[$x]['addr'] = $forums[$x]['xchan_addr'] ?? $forums[$x]['xchan_url']; $forums[$x]['url'] = $forums[$x]['xchan_url']; $forums[$x]['photo'] = $forums[$x]['xchan_photo_s']; $forums[$x]['unseen'] = count($b64mids); - $forums[$x]['private_forum'] = (($forums[$x]['private_forum']) ? 'lock' : ''); - $forums[$x]['message'] = (($forums[$x]['private_forum']) ? t('Private forum') : t('Public forum')); + $forums[$x]['private_forum'] = ((isset($forums[$x]['private_forum']) && $forums[$x]['private_forum']) ? 'lock' : ''); + $forums[$x]['message'] = ((isset($forums[$x]['private_forum']) && $forums[$x]['private_forum']) ? t('Private forum') : t('Public forum')); $forums[$x]['mids'] = json_encode($b64mids); unset($forums[$x]['abook_id']); diff --git a/Zotlabs/Module/Wfinger.php b/Zotlabs/Module/Wfinger.php index 6d0e78587..048fcde3f 100644 --- a/Zotlabs/Module/Wfinger.php +++ b/Zotlabs/Module/Wfinger.php @@ -21,7 +21,7 @@ class Wfinger extends \Zotlabs\Web\Controller { elseif(x($_SERVER,'HTTP_X_FORWARDED_PROTO') && ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) $scheme = 'https'; - $zot = intval($_REQUEST['zot']); + $zot = $_REQUEST['zot'] ?? ''; if(($scheme !== 'https') && (! $zot)) { header($_SERVER["SERVER_PROTOCOL"] . ' ' . 500 . ' ' . 'Webfinger requires HTTPS'); |