<?php
-include('library/asn1.php');
+require_once('library/asn1.php');
-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));
killme();
-}
\ No newline at end of file
+}
+