]> git.mxchange.org Git - friendica.git/commitdiff
Abort early if owner isn't found in mod/photos
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 17 Aug 2021 13:06:28 +0000 (09:06 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 17 Aug 2021 13:06:28 +0000 (09:06 -0400)
- Address https://github.com/friendica/friendica/issues/10473#issuecomment-894779649

mod/photos.php

index 45129210741acbcf2a46f3f9cbc1c3962dc274c2..bd56fbbc6a68203db5af39086669f3b8f50daaa2 100644 (file)
@@ -65,6 +65,9 @@ function photos_init(App $a) {
 
        if (DI::args()->getArgc() > 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']));