mirror of
https://github.com/friendica/friendica
synced 2025-04-26 11:10:11 +00:00
Replace System::httpExit() by HTTPException throwing
This commit is contained in:
parent
358baa9f62
commit
41f781c52a
39 changed files with 116 additions and 140 deletions
|
@ -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', '');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue