Abort early if owner isn't found in mod/photos

- Address https://github.com/friendica/friendica/issues/10473#issuecomment-894779649
pull/10612/head
Hypolite Petovan 2021-08-17 09:06:28 -04:00
rodzic 64d6df659d
commit 891c0ff130
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -65,6 +65,9 @@ function photos_init(App $a) {
if (DI::args()->getArgc() > 1) { if (DI::args()->getArgc() > 1) {
$owner = User::getOwnerDataByNick(DI::args()->getArgv()[1]); $owner = User::getOwnerDataByNick(DI::args()->getArgv()[1]);
if (!$owner) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
}
$is_owner = (local_user() && (local_user() == $owner['uid'])); $is_owner = (local_user() && (local_user() == $owner['uid']));