Merge pull request #5563 from MrPetovan/bug/5470-fix-various-notices
Fix various notices
This commit is contained in:
commit
eaf81e5e66
6 changed files with 37 additions and 27 deletions
|
@ -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;
|
||||
|
|
|
@ -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' : '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue