use Friendica\DI;
use Friendica\Model\Profile;
use Friendica\Model\User;
-use Friendica\Network\HTTPException\NotFoundException;
+use Friendica\Network\HTTPException;
/**
* Loads a profile for the HoverCard view
// Show the profile hovercard
$nickname = $parameters['profile'];
} else {
- throw new NotFoundException(DI::l10n()->t('No profile'));
+ throw new HTTPException\NotFoundException(DI::l10n()->t('No profile'));
}
Profile::load($a, $nickname);
+ if (empty($a->profile)) {
+ throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
+ }
+
$page = DI::page();
if (!empty($a->profile['page-flags']) && ($a->profile['page-flags'] == User::PAGE_FLAGS_COMMUNITY)) {
$uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $baseUrl->getHostname() . ($baseUrl->getUrlPath() ? '/' . $baseUrl->getUrlPath() : ''));
- $page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . (($a->profile['net-publish']) ? 'true' : 'false') . '" />' . "\r\n";
+ $page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . ($a->profile['net-publish'] ? 'true' : 'false') . '" />' . "\r\n";
$page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $baseUrl->get() . '/dfrn_poll/' . $nickname . '" />' . "\r\n";
$page['htmlhead'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . $baseUrl->get() . '/xrd/?uri=' . $uri . '" />' . "\r\n";
header('Link: <' . $baseUrl->get() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);