Add error handling in Module\Profile\Status

- Address part of https://github.com/friendica/friendica/issues/8475#issuecomment-653912096
This commit is contained in:
Hypolite Petovan 2020-07-08 09:49:39 -04:00
parent f2adec6a7f
commit 1f0b7690eb
1 changed files with 5 additions and 0 deletions

View File

@ -34,6 +34,7 @@ use Friendica\Model\Profile as ProfileModel;
use Friendica\Model\User;
use Friendica\Module\BaseProfile;
use Friendica\Module\Security\Login;
use Friendica\Network\HTTPException;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Security;
use Friendica\Util\Strings;
@ -49,6 +50,10 @@ class Status extends BaseProfile
ProfileModel::load($a, $parameters['nickname']);
if (empty($a->profile)) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
}
if (!$a->profile['net-publish']) {
DI::page()['htmlhead'] .= '<meta content="noindex, noarchive" name="robots" />' . "\n";
}