Merge branch 'dev' of ../p3 into dev

This commit is contained in:
nobody 2021-10-01 16:01:00 -07:00
commit 6992845c96
4 changed files with 22 additions and 22 deletions

View file

@ -2316,7 +2316,7 @@ class Activity {
$keywords = [];
if (is_array($person_obj['tag'])) {
if (isset($person_obj['tag']) && is_array($person_obj['tag'])) {
foreach ($person_obj['tag'] as $t) {
if (is_array($t) && isset($t['type']) && $t['type'] === 'Hashtag') {
if (isset($t['name'])) {
@ -2466,7 +2466,7 @@ class Activity {
$m = parse_url($url);
if ($m) {
$hostname = $m['host'];
$baseurl = $m['scheme'] . '://' . $m['host'] . (($m['port']) ? ':' . $m['port'] : '');
$baseurl = $m['scheme'] . '://' . $m['host'] . ((isset($m['port']) && intval($m['port'])) ? ':' . $m['port'] : '');
}
if (! $h) {
@ -2821,11 +2821,11 @@ class Activity {
// over-ride the object timestamp with the activity
if ($act->data['published']) {
if (isset($act->data['published']) && $act->data['published']) {
$s['created'] = datetime_convert('UTC','UTC',$act->data['published']);
}
if ($act->data['updated']) {
if (isset($act->data['updated']) && $act->data['updated']) {
$s['edited'] = datetime_convert('UTC','UTC',$act->data['updated']);
}
@ -3411,7 +3411,7 @@ class Activity {
// $s['html'] will be populated if caching was enabled.
// This is usually the case for ActivityPub sourced content, while Zot6 content is not cached.
if ($s['html']) {
if (isset($s['html']) && $s['html']) {
$s['html'] = bbcode($s['body'], [ 'bbonly' => true ] );
}

View file

@ -2081,7 +2081,7 @@ class Libzot {
);
$abook = (($ab) ? $ab[0] : null);
if (intval($arr['item_deleted'])) {
if (isset($arr['item_deleted']) && intval($arr['item_deleted'])) {
// set these just in case we need to store a fresh copy of the deleted post.
// This could happen if the delete got here before the original post did.

View file

@ -278,20 +278,20 @@ class Libzotdir {
$arr = [];
$arr['xprof_hash'] = $hash;
$arr['xprof_dob'] = (($profile['birthday'] === '0000-00-00') ? $profile['birthday'] : datetime_convert('','',$profile['birthday'],'Y-m-d')); // !!!! check this for 0000 year
$arr['xprof_dob'] = ((isset($profile['birthday']) && $profile['birthday'] === '0000-00-00') ? $profile['birthday'] : datetime_convert('','',$profile['birthday'],'Y-m-d')); // !!!! check this for 0000 year
$arr['xprof_age'] = (isset($profile['age']) ? intval($profile['age']) : 0);
$arr['xprof_desc'] = (($profile['description']) ? htmlspecialchars($profile['description'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_gender'] = (($profile['gender']) ? htmlspecialchars($profile['gender'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_marital'] = (($profile['marital']) ? htmlspecialchars($profile['marital'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_sexual'] = (($profile['sexual']) ? htmlspecialchars($profile['sexual'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_locale'] = (($profile['locale']) ? htmlspecialchars($profile['locale'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_region'] = (($profile['region']) ? htmlspecialchars($profile['region'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_postcode'] = (($profile['postcode']) ? htmlspecialchars($profile['postcode'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_country'] = (($profile['country']) ? htmlspecialchars($profile['country'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_about'] = (($profile['about']) ? htmlspecialchars($profile['about'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_pronouns'] = (isset($profile['pronouns']) ? htmlspecialchars($profile['pronouns'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_homepage'] = (($profile['homepage']) ? htmlspecialchars($profile['homepage'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_hometown'] = (($profile['hometown']) ? htmlspecialchars($profile['hometown'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_desc'] = ((isset($profile['description']) && $profile['description']) ? htmlspecialchars($profile['description'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_gender'] = ((isset($profile['gender']) && $profile['gender']) ? htmlspecialchars($profile['gender'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_marital'] = ((isset($profile['marital']) && $profile['marital']) ? htmlspecialchars($profile['marital'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_sexual'] = ((isset($profile['sexual']) && $profile['sexual']) ? htmlspecialchars($profile['sexual'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_locale'] = ((isset($profile['locale']) && $profile['locale']) ? htmlspecialchars($profile['locale'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_region'] = ((isset($profile['region']) && $profile['region']) ? htmlspecialchars($profile['region'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_postcode'] = ((isset($profile['postcode']) && $profile['postcode']) ? htmlspecialchars($profile['postcode'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_country'] = ((isset($profile['country']) && $profile['country']) ? htmlspecialchars($profile['country'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_about'] = ((isset($profile['about']) && $profile['about']) ? htmlspecialchars($profile['about'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_pronouns'] = ((isset($profile['pronouns']) && $profile['pronouns']) ? htmlspecialchars($profile['pronouns'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_homepage'] = ((isset($profile['homepage']) && $profile['homepage']) ? htmlspecialchars($profile['homepage'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_hometown'] = ((isset($profile['hometown']) && $profile['hometown']) ? htmlspecialchars($profile['hometown'], ENT_COMPAT,'UTF-8',false) : '');
$clean = [];
if (array_key_exists('keywords', $profile) and is_array($profile['keywords'])) {

View file

@ -1907,7 +1907,7 @@ function item_store($arr, $allow_exec = false, $deliver = true, $linkid = true)
return $ret;
}
if (LibBlock::fetch_by_entity($arr['uid'],$arr['owner_chan']) || LibBlock::fetch_by_entity($arr['uid'],$arr['author_xchan'])) {
if (LibBlock::fetch_by_entity($arr['uid'],$arr['owner_xchan']) || LibBlock::fetch_by_entity($arr['uid'],$arr['author_xchan'])) {
logger('Post cancelled by block rule.');
$ret['message'] = 'cancelled.';
return $ret;
@ -2497,7 +2497,7 @@ function send_status_notifications($post_id,$item) {
// I'm the owner - notify me
if($item['owner_hash'] === $r[0]['channel_hash'])
if($item['owner_xchan'] === $r[0]['channel_hash'])
$notify = true;
// Was I involved in this conversation?
@ -3427,7 +3427,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
function check_item_source($uid, $item) {
logger('source: uid: ' . $uid, LOGGER_DEBUG);
$xchan = (($item['source_xchan'] && intval($item['item_uplink'])) ? $item['source_xchan'] : $item['owner_xchan']);
$xchan = ((isset($item['source_xchan']) && $item['source_xchan'] && isset($item['item_uplink']) && intval($item['item_uplink'])) ? $item['source_xchan'] : $item['owner_xchan']);
$r = q("select * from source where src_channel_id = %d and ( src_xchan = '%s' or src_xchan = '*' ) limit 1",
intval($uid),