]> git.mxchange.org Git - friendica.git/blobdiff - mod/xrd.php
Merge pull request #3149 from annando/1601-new-diaspora-mention
[friendica.git] / mod / xrd.php
index 576ae9b38fafdd462738d4487595556925021ebf..7b812a7f9d94610d804515ba2e454cdf855762b0 100644 (file)
@@ -2,7 +2,7 @@
 
 require_once('include/crypto.php');
 
-function xrd_init(&$a) {
+function xrd_init(App $a) {
 
        $uri = urldecode(notags(trim($_GET['uri'])));
 
@@ -21,8 +21,9 @@ function xrd_init(&$a) {
        $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1",
                dbesc($name)
        );
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                killme();
+       }
 
        $salmon_key = salmon_key($r[0]['spubkey']);
 
@@ -40,13 +41,15 @@ function xrd_init(&$a) {
 
        $profile_url = App::get_baseurl().'/profile/'.$r[0]['nickname'];
 
-       if ($acct)
+       if ($acct) {
                $alias = $profile_url;
+       }
        else {
                $alias = 'acct:'.$r[0]['nickname'].'@'.$a->get_hostname();
 
-               if ($a->get_path())
+               if ($a->get_path()) {
                        $alias .= '/'.$a->get_path();
+               }
        }
 
        $o = replace_macros($tpl, array(
@@ -64,7 +67,7 @@ function xrd_init(&$a) {
                '$salmen'      => App::get_baseurl() . '/salmon/'        . $r[0]['nickname'] . '/mention',
                '$subscribe'   => App::get_baseurl() . '/follow?url={uri}',
                '$modexp'      => 'data:application/magic-public-key,'  . $salmon_key,
-               '$bigkey'      =>  salmon_key($r[0]['pubkey'])
+               '$bigkey'      => salmon_key($r[0]['pubkey']),
        ));