X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FDebug%2FWebFinger.php;h=6c1ca51e5fac9083993bd5837118f2f209268bc9;hb=1d6f5c33a1a7c538d4e529d22701fd735855da15;hp=2b0b9c53b494c54335627dcbad770b1f0cf11598;hpb=492d7abe928c63d62ee9794aa5ff23ec374aece9;p=friendica.git diff --git a/src/Module/Debug/WebFinger.php b/src/Module/Debug/WebFinger.php index 2b0b9c53b4..6c1ca51e5f 100644 --- a/src/Module/Debug/WebFinger.php +++ b/src/Module/Debug/WebFinger.php @@ -1,10 +1,29 @@ . + * + */ namespace Friendica\Module\Debug; use Friendica\BaseModule; -use Friendica\Core\L10n; use Friendica\Core\Renderer; +use Friendica\DI; use Friendica\Network\Probe; /** @@ -12,15 +31,13 @@ use Friendica\Network\Probe; */ class WebFinger extends BaseModule { - public static function content() + protected function content(array $request = []): string { - 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; + if (!DI::userSession()->getLocalUserId()) { + throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.')); } - $addr = defaults($_GET, 'addr', ''); + $addr = $_GET['addr'] ?? ''; $res = ''; if (!empty($addr)) { @@ -30,8 +47,11 @@ class WebFinger extends BaseModule $tpl = Renderer::getMarkupTemplate('webfinger.tpl'); return Renderer::replaceMacros($tpl, [ - '$addr' => $addr, - '$res' => $res, + '$title' => DI::l10n()->t('Webfinger Diagnostic'), + '$submit' => DI::l10n()->t('Submit'), + '$lookup' => DI::l10n()->t('Lookup address:'), + '$addr' => $addr, + '$res' => $res, ]); } }