1
0
Fork 0

Merge pull request #6531 from Ixiter/develop-theme-frio

frio - fix PHP Notices reported in #6338
This commit is contained in:
Hypolite Petovan 2019-01-27 08:01:08 -05:00 committed by GitHub
commit c9a6063a2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -237,25 +237,25 @@ function frio_remote_nav($a, &$nav)
} elseif (!local_user() && remote_user()) { } elseif (!local_user() && remote_user()) {
$r = q("SELECT `name`, `nick`, `micro` AS `photo` FROM `contact` WHERE `id` = %d", intval(remote_user())); $r = q("SELECT `name`, `nick`, `micro` AS `photo` FROM `contact` WHERE `id` = %d", intval(remote_user()));
$nav['remote'] = L10n::t('Guest'); $nav['remote'] = L10n::t('Guest');
$remoteUser = $r[0];
} elseif (Model\Profile::getMyURL()) { } elseif (Model\Profile::getMyURL()) {
$r = q("SELECT `name`, `nick`, `photo` FROM `gcontact` $r = q("SELECT `name`, `nick`, `photo` FROM `gcontact`
WHERE `addr` = '%s' AND `network` = 'dfrn'", WHERE `addr` = '%s' AND `network` = 'dfrn'",
DBA::escape($webbie)); DBA::escape($webbie));
$nav['remote'] = L10n::t('Visitor'); $nav['remote'] = L10n::t('Visitor');
$remoteUser = $r[0];
} else { } else {
$r = false; $r = false;
} }
$remoteUser = null;
if (DBA::isResult($r)) { if (DBA::isResult($r)) {
$nav['userinfo'] = [ $nav['userinfo'] = [
'icon' => (DBA::isResult($r) ? $r[0]['photo'] : 'images/person-48.jpg'), 'icon' => (DBA::isResult($r) ? $r[0]['photo'] : 'images/person-48.jpg'),
'name' => $r[0]['name'], 'name' => $r[0]['name'],
]; ];
$remoteUser = $r[0];
} }
if (!local_user() && !empty($server_url)) { if (!local_user() && !empty($server_url) && !is_null($remoteUser)) {
$nav['logout'] = [$server_url . '/logout', L10n::t('Logout'), '', L10n::t('End this session')]; $nav['logout'] = [$server_url . '/logout', L10n::t('Logout'), '', L10n::t('End this session')];
// user menu // user menu