use Friendica\App;
use Friendica\Core\Addon;
+use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Protocol\Salmon;
+use Friendica\Util\Strings;
function xrd_init(App $a)
{
if ($a->argv[0] == 'xrd') {
if (empty($_GET['uri'])) {
- killme();
+ System::httpExit(404);
}
- $uri = urldecode(notags(trim($_GET['uri'])));
+ $uri = urldecode(Strings::escapeTags(trim($_GET['uri'])));
if (defaults($_SERVER, 'HTTP_ACCEPT', '') == 'application/jrd+json') {
$mode = 'json';
} else {
}
} else {
if (empty($_GET['resource'])) {
- killme();
+ System::httpExit(404);
}
- $uri = urldecode(notags(trim($_GET['resource'])));
+ $uri = urldecode(Strings::escapeTags(trim($_GET['resource'])));
if (defaults($_SERVER, 'HTTP_ACCEPT', '') == 'application/xrd+xml') {
$mode = 'xml';
} else {
$user = DBA::selectFirst('user', [], ['nickname' => $name]);
if (!DBA::isResult($user)) {
- killme();
+ System::httpExit(404);
}
$profile_url = System::baseUrl().'/profile/'.$user['nickname'];
header('Access-Control-Allow-Origin: *');
header("Content-type: text/xml");
- $tpl = get_markup_template('xrd_person.tpl');
+ $tpl = Renderer::getMarkupTemplate('xrd_person.tpl');
- $o = replace_macros($tpl, [
+ $o = Renderer::replaceMacros($tpl, [
'$nick' => $r['nickname'],
'$accturi' => $uri,
'$alias' => $alias,