]> git.mxchange.org Git - friendica.git/blob - mod/webfinger.php
Fix formatting and PHP notice in mod/photos
[friendica.git] / mod / webfinger.php
1 <?php
2
3 use Friendica\App;
4 use Friendica\Network\Probe;
5
6 function webfinger_content(App $a) {
7
8         if (!local_user()) {
9                 http_status_exit(403,
10                                 array("title" => t("Public access denied."),
11                                         "description" => t("Only logged in users are permitted to perform a probing.")));
12                 killme();
13         }
14
15         $o .= '<h3>Webfinger Diagnostic</h3>';
16
17         $o .= '<form action="webfinger" method="get">';
18         $o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" />';
19         $o .= '<input type="submit" name="submit" value="Submit" /></form>';
20
21         $o .= '<br /><br />';
22
23         if(x($_GET,'addr')) {
24                 $addr = trim($_GET['addr']);
25                 $res = Probe::lrdd($addr);
26                 $o .= '<pre>';
27                 $o .= str_replace("\n",'<br />',print_r($res,true));
28                 $o .= '</pre>';
29         }
30         return $o;
31 }