]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/PublicRSAKey.php
Possibly Avoid database error when storing photo item
[friendica.git] / src / Module / PublicRSAKey.php
index ad9bb6db849dffb48322324f0c5569b86fc4e066..f0e9dc285b39a483b30bc2fa708added0dfa57ca 100644 (file)
@@ -27,24 +27,19 @@ 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
  */
 class PublicRSAKey extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       protected function rawContent(array $request = [])
        {
-               $app = DI::app();
-
-               // @TODO: Replace with parameter from router
-               if ($app->argc !== 2) {
+               if (empty($this->parameters['nick'])) {
                        throw new BadRequestException();
                }
 
-               // @TODO: Replace with parameter from router
-               $nick = $app->argv[1];
+               $nick = $this->parameters['nick'];
 
                $user = User::getByNickname($nick, ['spubkey']);
                if (empty($user) || empty($user['spubkey'])) {