Merge pull request #9041 from MrPetovan/bug/notices

Fix various notices
This commit is contained in:
Michael Vogel 2020-08-20 16:21:18 +02:00 committed by GitHub
commit 61a2b225bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 14 deletions

View File

@ -140,6 +140,10 @@ abstract class BaseModule
return false; return false;
} }
if (empty($a->user)) {
return false;
}
$sec_hash = hash('whirlpool', $a->user['guid'] . $a->user['prvkey'] . session_id() . $x[0] . $typename); $sec_hash = hash('whirlpool', $a->user['guid'] . $a->user['prvkey'] . session_id() . $x[0] . $typename);
return ($sec_hash == $x[1]); return ($sec_hash == $x[1]);

View File

@ -350,7 +350,7 @@ class Acl extends BaseModule
'type' => 'c', 'type' => 'c',
'photo' => Contact::getMicro($contact), 'photo' => Contact::getMicro($contact),
'name' => htmlspecialchars($contact['name']), 'name' => htmlspecialchars($contact['name']),
'id' => intval($contact['cid']), 'id' => intval($contact['id']),
'network' => $contact['network'], 'network' => $contact['network'],
'link' => $contact['url'], 'link' => $contact['url'],
'nick' => htmlentities(($contact['nick'] ?? '') ?: $contact['addr']), 'nick' => htmlentities(($contact['nick'] ?? '') ?: $contact['addr']),

View File

@ -114,14 +114,11 @@ class UserExport extends BaseSettings
$rows = DBA::p($query); $rows = DBA::p($query);
while ($row = DBA::fetch($rows)) { while ($row = DBA::fetch($rows)) {
$p = []; $p = [];
foreach ($row as $k => $v) { foreach ($dbStructure[$table]['fields'] as $column => $field) {
switch ($dbStructure[$table]['fields'][$k]['type']) { if ($field['type'] == 'datetime') {
case 'datetime': $p[$column] = $v ?? DBA::NULL_DATETIME;
$p[$k] = $v ?? DBA::NULL_DATETIME; } else {
break; $p[$column] = $v;
default:
$p[$k] = $v;
break;
} }
} }
$result[] = $p; $result[] = $p;

View File

@ -963,10 +963,12 @@ class DFRN
if ($item['gravity'] != GRAVITY_PARENT) { if ($item['gravity'] != GRAVITY_PARENT) {
$parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent-uri']); $parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent-uri']);
$parent = Item::selectFirst(['guid', 'plink'], ['uri' => $parent_item, 'uid' => $item['uid']]); $parent = Item::selectFirst(['guid', 'plink'], ['uri' => $parent_item, 'uid' => $item['uid']]);
$attributes = ["ref" => $parent_item, "type" => "text/html", if (DBA::isResult($parent)) {
"href" => $parent['plink'], $attributes = ["ref" => $parent_item, "type" => "text/html",
"dfrn:diaspora_guid" => $parent['guid']]; "href" => $parent['plink'],
XML::addElement($doc, $entry, "thr:in-reply-to", "", $attributes); "dfrn:diaspora_guid" => $parent['guid']];
XML::addElement($doc, $entry, "thr:in-reply-to", "", $attributes);
}
} }
// Add conversation data. This is used for OStatus // Add conversation data. This is used for OStatus

View File

@ -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 '<meta name="theme-color" content="' . $nav_bg . '" />'; echo '<meta name="theme-color" content="' . $nav_bg . '" />';
?> ?>