Replace System::httpExit() by HTTPException throwing

This commit is contained in:
Hypolite Petovan 2019-05-01 23:16:10 -04:00
parent 358baa9f62
commit 41f781c52a
39 changed files with 116 additions and 140 deletions

View file

@ -5,7 +5,6 @@ namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Network\Probe;
/**
@ -13,22 +12,14 @@ use Friendica\Network\Probe;
*/
class WebFinger extends BaseModule
{
public static function init()
{
if (!local_user()) {
System::httpExit(
403,
[
'title' => L10n::t('Public access denied.'),
'description' => L10n::t('Only logged in users are permitted to perform a probing.'),
],
);
exit();
}
}
public static function content()
{
if (!local_user()) {
$e = new \Friendica\Network\HTTPException\ForbiddenException(L10n::t("Only logged in users are permitted to perform a probing."));
$e->httpdesc = L10n::t("Public access denied.");
throw $e;
}
$app = self::getApp();
$addr = defaults($_GET, 'addr', '');