]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/PublicRSAKey.php
Some more API functions moved
[friendica.git] / src / Module / PublicRSAKey.php
index ad9bb6db849dffb48322324f0c5569b86fc4e066..a13130d1c98bdd86e2c2b49b0db0483ffd447348 100644 (file)
@@ -27,7 +27,6 @@ use Friendica\Model\User;
 use Friendica\Network\HTTPException\BadRequestException;
 use Friendica\Util\Crypto;
 use Friendica\Util\Strings;
-use phpseclib\File\ASN1;
 
 /**
  * prints the public RSA key of a user
@@ -36,15 +35,11 @@ class PublicRSAKey extends BaseModule
 {
        public static function rawContent(array $parameters = [])
        {
-               $app = DI::app();
-
-               // @TODO: Replace with parameter from router
-               if ($app->argc !== 2) {
+               if (empty($parameters['nick'])) {
                        throw new BadRequestException();
                }
 
-               // @TODO: Replace with parameter from router
-               $nick = $app->argv[1];
+               $nick = $parameters['nick'];
 
                $user = User::getByNickname($nick, ['spubkey']);
                if (empty($user) || empty($user['spubkey'])) {