php errors from logs

This commit is contained in:
Mike Macgirvin 2024-07-22 08:20:20 +10:00
parent 02f51ec7ff
commit 165d50e932
2 changed files with 15 additions and 3 deletions

View file

@ -167,6 +167,15 @@ class ActivityStreams
if ((!$this->parent_id) && is_array($this->obj)) {
$this->parent_id = $this->obj['id'];
}
if (is_array($this->parent_id)) {
if (array_key_exists(0, $this->parent_id)) {
$this->parent_id = $this->parent_id[0];
}
else {
btlogger('parent_id is array: ' . print_r($this->parent_id, true));
$this->parent_id = '';
}
}
}
}

View file

@ -356,8 +356,11 @@ class Display extends Controller
// see if the top-level post owner chose to block search engines
if ($items && get_pconfig($items[0]['uid'], 'system', 'noindex')) {
App::$meta->set('robots', 'noindex, noarchive');
if ($items) {
$signingChannel = Channel::from_id($items[0]['uid']);
if(get_pconfig($items[0]['uid'], 'system', 'noindex')) {
App::$meta->set('robots', 'noindex, noarchive');
}
}
foreach ($items as $item) {
@ -421,7 +424,7 @@ class Display extends Controller
if (!$json) {
$json = Activity::encode_activity($item, true);
$json = array_merge(Activity::ap_context(''), $json);
$json['proof'] = (new JcsEddsa2022)->sign($json, $channel);
$json['proof'] = (new JcsEddsa2022)->sign($json, $signingChannel);
}
App::$meta->setjson($json);
}