]> git.mxchange.org Git - friendica.git/blobdiff - mod/modexp.php
Replace old database queries with the new ones
[friendica.git] / mod / modexp.php
index d424b4c39d75f90652fdfb3be4837306ff113066..6fdc1884d2b13cb351d13131c01088ae7c21e59f 100644 (file)
@@ -1,21 +1,23 @@
 <?php
 
-include('library/asn1.php');
+use Friendica\App;
+use Friendica\Database\DBM;
 
-function modexp_init(&$a) {
+function modexp_init(App $a) {
 
        if($a->argc != 2)
                killme();
 
        $nick = $a->argv[1];
-       $r = q("SELECT `pubkey` FROM `user` WHERE `nickname` = '%s' LIMIT 1",
+       $r = q("SELECT `spubkey` FROM `user` WHERE `nickname` = '%s' LIMIT 1",
                        dbesc($nick)
        );
 
-       if(! count($r))
+       if (! DBM::is_result($r)) {
                killme();
+       }
 
-       $lines = explode("\n",$r[0]['pubkey']);
+       $lines = explode("\n",$r[0]['spubkey']);
        unset($lines[0]);
        unset($lines[count($lines)]);
        $x = base64_decode(implode('',$lines));
@@ -30,4 +32,5 @@ function modexp_init(&$a) {
 
        killme();
 
-}
\ No newline at end of file
+}
+