]> git.mxchange.org Git - friendica.git/blobdiff - mod/webfinger.php
Some improvements
[friendica.git] / mod / webfinger.php
index 4024671b02f271c5a31956b58d54bb98afaf2259..d72315a5b51e77c25444fa363885074910f0b7b5 100644 (file)
@@ -1,7 +1,16 @@
 <?php
 
-if(! function_exists('webfinger_content')) {
-function webfinger_content(&$a) {
+use Friendica\App;
+use Friendica\Network\Probe;
+
+function webfinger_content(App $a) {
+
+       if (!local_user()) {
+               http_status_exit(403,
+                               array("title" => t("Public access denied."),
+                                       "description" => t("Only logged in users are permitted to perform a probing.")));
+               killme();
+       }
 
        $o .= '<h3>Webfinger Diagnostic</h3>';
 
@@ -13,14 +22,10 @@ function webfinger_content(&$a) {
 
        if(x($_GET,'addr')) {
                $addr = trim($_GET['addr']);
-               if(strpos($addr,'@' !== false))
-                       $res = webfinger($addr);
-               else
-                       $res = lrdd($addr);
+               $res = Probe::lrdd($addr);
                $o .= '<pre>';
                $o .= str_replace("\n",'<br />',print_r($res,true));
                $o .= '</pre>';
        }
        return $o;
 }
-}