X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fxrd.php;h=05b07dc162505a1bc76248a90ab686081f253123;hb=430bd7c6ac2ead5c72557e0fe2e004a41a21ba9b;hp=363994a8d42e22eae7177fd14a36c92fc1e42cf6;hpb=6925299e5a52464cc39eddd431be6e9e498f80ed;p=friendica.git diff --git a/mod/xrd.php b/mod/xrd.php index 363994a8d4..05b07dc162 100644 --- a/mod/xrd.php +++ b/mod/xrd.php @@ -29,30 +29,31 @@ function xrd_init(App $a) $name = ltrim(basename($uri), '~'); } else { $local = str_replace('acct:', '', $uri); - if (substr($local, 0, 2) == '//') + if (substr($local, 0, 2) == '//') { $local = substr($local, 2); + } $name = substr($local, 0, strpos($local, '@')); } - $r = dba::select('user', array(), array('nickname' => $name), array('limit' => 1)); - if (!DBM::is_result($r)) { + $user = dba::selectFirst('user', [], ['nickname' => $name]); + if (!DBM::is_result($user)) { killme(); } - $profile_url = System::baseUrl().'/profile/'.$r['nickname']; + $profile_url = System::baseUrl().'/profile/'.$user['nickname']; $alias = str_replace('/profile/', '/~', $profile_url); - $addr = 'acct:'.$r['nickname'].'@'.$a->get_hostname(); + $addr = 'acct:'.$user['nickname'].'@'.$a->get_hostname(); if ($a->get_path()) { $addr .= '/'.$a->get_path(); } if ($mode == 'xml') { - xrd_xml($a, $addr, $alias, $profile_url, $r); + xrd_xml($a, $addr, $alias, $profile_url, $user); } else { - xrd_json($a, $addr, $alias, $profile_url, $r); + xrd_json($a, $addr, $alias, $profile_url, $user); } }