From 891c0ff130c9f3757d6fb41f56d8aed476d4cd59 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 17 Aug 2021 09:06:28 -0400 Subject: [PATCH 1/3] Abort early if owner isn't found in mod/photos - Address https://github.com/friendica/friendica/issues/10473#issuecomment-894779649 --- mod/photos.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mod/photos.php b/mod/photos.php index 4512921074..bd56fbbc6a 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -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'])); From 6f13663c4517c0460ba218319c71b40f2d1d13f1 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 17 Aug 2021 09:35:44 -0400 Subject: [PATCH 2/3] Return early if body is empty in Network\Probe::updateFromFeed - Address https://github.com/friendica/friendica/issues/10473#issuecomment-894815271 --- src/Network/Probe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Network/Probe.php b/src/Network/Probe.php index 1a4c47a452..8cee679400 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -2167,7 +2167,7 @@ class Probe { // Search for the newest entry in the feed $curlResult = DI::httpRequest()->get($data['poll']); - if (!$curlResult->isSuccess()) { + if (!$curlResult->isSuccess() || !$curlResult->getBody()) { return ''; } From 0a592fbf34345044c4c621f67824034c825b7915 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 17 Aug 2021 09:38:35 -0400 Subject: [PATCH 3/3] Abort early if owner isn't found in Module\RemoteFollow - Address https://github.com/friendica/friendica/issues/10473#issuecomment-899099987 --- src/Module/RemoteFollow.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Module/RemoteFollow.php b/src/Module/RemoteFollow.php index 0950a057a5..f1e653f1ce 100644 --- a/src/Module/RemoteFollow.php +++ b/src/Module/RemoteFollow.php @@ -32,6 +32,7 @@ use Friendica\Core\System; use Friendica\Model\Contact; use Friendica\Model\Profile; use Friendica\Model\User; +use Friendica\Network\HTTPException; use Friendica\Network\Probe; /** @@ -44,6 +45,9 @@ class RemoteFollow extends BaseModule public static function init(array $parameters = []) { self::$owner = User::getOwnerDataByNick($parameters['profile']); + if (!self::$owner) { + throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.')); + } DI::page()['aside'] = Widget\VCard::getHTML(self::$owner); }