]> git.mxchange.org Git - friendica.git/blobdiff - mod/xrd.php
And still there are notices that have to be removed ... (#5629)
[friendica.git] / mod / xrd.php
index 29ee1057a2696c34442e595c375e13d4bab7d353..61505f29966e99d2ea4f66f27d2cb091a8bf16cc 100644 (file)
@@ -2,15 +2,20 @@
 /**
  * @file mod/xrd.php
  */
+
 use Friendica\App;
 use Friendica\Core\Addon;
 use Friendica\Core\System;
-use Friendica\Database\DBM;
+use Friendica\Database\DBA;
 use Friendica\Protocol\Salmon;
 
 function xrd_init(App $a)
 {
        if ($a->argv[0] == 'xrd') {
+               if (empty($_GET['uri'])) {
+                       killme();
+               }
+
                $uri = urldecode(notags(trim($_GET['uri'])));
                if (defaults($_SERVER, 'HTTP_ACCEPT', '') == 'application/jrd+json') {
                        $mode = 'json';
@@ -18,6 +23,10 @@ function xrd_init(App $a)
                        $mode = 'xml';
                }
        } else {
+               if (empty($_GET['resource'])) {
+                       killme();
+               }
+
                $uri = urldecode(notags(trim($_GET['resource'])));
                if (defaults($_SERVER, 'HTTP_ACCEPT', '') == 'application/xrd+xml') {
                        $mode = 'xml';
@@ -37,8 +46,8 @@ function xrd_init(App $a)
                $name = substr($local, 0, strpos($local, '@'));
        }
 
-       $user = dba::selectFirst('user', [], ['nickname' => $name]);
-       if (!DBM::is_result($user)) {
+       $user = DBA::selectFirst('user', [], ['nickname' => $name]);
+       if (!DBA::isResult($user)) {
                killme();
        }