diff --git a/src/BaseModule.php b/src/BaseModule.php index ce7774bfd0..a9f67f2375 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -140,6 +140,10 @@ abstract class BaseModule return false; } + if (empty($a->user)) { + return false; + } + $sec_hash = hash('whirlpool', $a->user['guid'] . $a->user['prvkey'] . session_id() . $x[0] . $typename); return ($sec_hash == $x[1]); diff --git a/src/Module/Search/Acl.php b/src/Module/Search/Acl.php index eb6dc6f859..e8b6f357d9 100644 --- a/src/Module/Search/Acl.php +++ b/src/Module/Search/Acl.php @@ -350,7 +350,7 @@ class Acl extends BaseModule 'type' => 'c', 'photo' => Contact::getMicro($contact), 'name' => htmlspecialchars($contact['name']), - 'id' => intval($contact['cid']), + 'id' => intval($contact['id']), 'network' => $contact['network'], 'link' => $contact['url'], 'nick' => htmlentities(($contact['nick'] ?? '') ?: $contact['addr']), diff --git a/src/Module/Settings/UserExport.php b/src/Module/Settings/UserExport.php index 0eaa72ffe6..132505371e 100644 --- a/src/Module/Settings/UserExport.php +++ b/src/Module/Settings/UserExport.php @@ -114,14 +114,11 @@ class UserExport extends BaseSettings $rows = DBA::p($query); while ($row = DBA::fetch($rows)) { $p = []; - foreach ($row as $k => $v) { - switch ($dbStructure[$table]['fields'][$k]['type']) { - case 'datetime': - $p[$k] = $v ?? DBA::NULL_DATETIME; - break; - default: - $p[$k] = $v; - break; + foreach ($dbStructure[$table]['fields'] as $column => $field) { + if ($field['type'] == 'datetime') { + $p[$column] = $v ?? DBA::NULL_DATETIME; + } else { + $p[$column] = $v; } } $result[] = $p; diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 064f1f3aca..b09c1bea0f 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -963,10 +963,12 @@ class DFRN if ($item['gravity'] != GRAVITY_PARENT) { $parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent-uri']); $parent = Item::selectFirst(['guid', 'plink'], ['uri' => $parent_item, 'uid' => $item['uid']]); - $attributes = ["ref" => $parent_item, "type" => "text/html", - "href" => $parent['plink'], - "dfrn:diaspora_guid" => $parent['guid']]; - XML::addElement($doc, $entry, "thr:in-reply-to", "", $attributes); + if (DBA::isResult($parent)) { + $attributes = ["ref" => $parent_item, "type" => "text/html", + "href" => $parent['plink'], + "dfrn:diaspora_guid" => $parent['guid']]; + XML::addElement($doc, $entry, "thr:in-reply-to", "", $attributes); + } } // Add conversation data. This is used for OStatus diff --git a/view/theme/frio/php/default.php b/view/theme/frio/php/default.php index ca661c2830..949417ccf2 100644 --- a/view/theme/frio/php/default.php +++ b/view/theme/frio/php/default.php @@ -71,7 +71,7 @@ $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser"; } } - $nav_bg = $nav_bg ?: DI::pConfig()->get($uid, 'frio', 'nav_bg', DI::config()->get('frio', 'nav_bg', '#708fa0')); + $nav_bg = $nav_bg ?? DI::pConfig()->get($uid, 'frio', 'nav_bg', DI::config()->get('frio', 'nav_bg', '#708fa0')); echo ''; ?>