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;
}
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]);

View File

@ -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']),

View File

@ -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;

View File

@ -963,11 +963,13 @@ 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']]);
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
$conversation_href = DI::baseUrl()."/display/".$item["parent-guid"];

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 . '" />';
?>