]> git.mxchange.org Git - friendica.git/blobdiff - mod/salmon.php
Merge pull request #11293 from annando/api-direct
[friendica.git] / mod / salmon.php
index de8d97133452d8bac9303fc067dbd07057aba82c..a4eb3f81e2631ac19f584e3ff3cc1d743a0d4785 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -24,7 +24,6 @@ use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
 use Friendica\Database\DBA;
 use Friendica\DI;
-use Friendica\Model\Contact;
 use Friendica\Model\GServer;
 use Friendica\Model\Post;
 use Friendica\Protocol\ActivityNamespace;
@@ -42,7 +41,7 @@ function salmon_post(App $a, $xml = '') {
 
        Logger::debug('new salmon ' . $xml);
 
-       $nick       = ((DI::args()->getArgc() > 1) ? Strings::escapeTags(trim(DI::args()->getArgv()[1])) : '');
+       $nick = trim(DI::args()->getArgv()[1] ?? '');
 
        $importer = DBA::selectFirst('user', [], ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false]);
        if (! DBA::isResult($importer)) {
@@ -158,7 +157,7 @@ function salmon_post(App $a, $xml = '') {
        *
        */
 
-       $contact = DBA::selectFirst('contact', ["`network` IN (?, ?) AND (`nurl` = ? OR `alias` = ? OR `alias` = ?) AND `uid` = ?",
+       $contact = DBA::selectFirst('contact', [], ["`network` IN (?, ?) AND (`nurl` = ? OR `alias` = ? OR `alias` = ?) AND `uid` = ?",
                Protocol::OSTATUS, Protocol::DFRN, Strings::normaliseLink($author_link), $author_link, Strings::normaliseLink($author_link), $importer['uid']]);
 
        if (!empty($contact['gsid'])) {