1
0
Fork 0

Merge pull request #5563 from MrPetovan/bug/5470-fix-various-notices

Fix various notices
This commit is contained in:
Michael Vogel 2018-08-07 21:34:47 +02:00 committed by GitHub
commit eaf81e5e66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 37 additions and 27 deletions

View file

@ -29,11 +29,11 @@ function cal_init(App $a)
}
if (Config::get('system', 'block_public') && !local_user() && !remote_user()) {
return;
System::httpExit(403, ['title' => L10n::t('Access denied.')]);
}
if ($a->argc < 2) {
System::httpExit(403, ["title" => L10n::t('Access denied.')]);
System::httpExit(403, ['title' => L10n::t('Access denied.')]);
}
Nav::setSelected('events');
@ -41,7 +41,7 @@ function cal_init(App $a)
$nick = $a->argv[1];
$user = DBA::selectFirst('user', [], ['nickname' => $nick, 'blocked' => false]);
if (!DBA::isResult($user)) {
return;
System::httpExit(404, ['title' => L10n::t('Page not found.')]);
}
$a->data['user'] = $user;

View file

@ -1260,6 +1260,8 @@ function photos_content(App $a)
);
if (DBA::isResult($prvnxt)) {
$prv = null;
$nxt = null;
foreach ($prvnxt as $z => $entry) {
if ($entry['resource-id'] == $ph[0]['resource-id']) {
$prv = $z - 1;
@ -1274,8 +1276,12 @@ function photos_content(App $a)
}
}
$edit_suffix = ((($cmd === 'edit') && $can_post) ? '/edit' : '');
$prevlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] . $edit_suffix . ($order_field === 'posted' ? '?f=&order=posted' : '');
$nextlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] . $edit_suffix . ($order_field === 'posted' ? '?f=&order=posted' : '');
if (!is_null($prv)) {
$prevlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] . $edit_suffix . ($order_field === 'posted' ? '?f=&order=posted' : '');
}
if (!is_null($nxt)) {
$nextlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] . $edit_suffix . ($order_field === 'posted' ? '?f=&order=posted' : '');
}
}
}