aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-09-13 20:40:01 -0700
committerzotlabs <mike@macgirvin.com>2017-09-13 20:40:01 -0700
commitb5966041be46ab7a16dc1ee93b5a07c5461bc73c (patch)
tree123300e5f27d653074bee3fb4c8a859500e78042
parent62d6bada4c80a45e7e06f5dd1de599a5d039da76 (diff)
downloadvolse-hubzilla-b5966041be46ab7a16dc1ee93b5a07c5461bc73c.tar.gz
volse-hubzilla-b5966041be46ab7a16dc1ee93b5a07c5461bc73c.tar.bz2
volse-hubzilla-b5966041be46ab7a16dc1ee93b5a07c5461bc73c.zip
more zot6
-rw-r--r--Zotlabs/Module/Post.php9
-rw-r--r--Zotlabs/Web/HTTPSig.php7
-rw-r--r--include/connections.php15
-rw-r--r--include/zot.php1
4 files changed, 26 insertions, 6 deletions
diff --git a/Zotlabs/Module/Post.php b/Zotlabs/Module/Post.php
index c78484a45..dba26075f 100644
--- a/Zotlabs/Module/Post.php
+++ b/Zotlabs/Module/Post.php
@@ -19,12 +19,19 @@ class Post extends \Zotlabs\Web\Controller {
function init() {
if(array_key_exists('auth', $_REQUEST)) {
$x = new \Zotlabs\Zot\Auth($_REQUEST);
-
exit;
}
}
function post() {
+
+
+
+
+
+
+
+
$z = new \Zotlabs\Zot\Receiver($_REQUEST['data'], get_config('system', 'prvkey'), new \Zotlabs\Zot\ZotHandler());
// notreached;
diff --git a/Zotlabs/Web/HTTPSig.php b/Zotlabs/Web/HTTPSig.php
index fee8aaa41..6526fa7c8 100644
--- a/Zotlabs/Web/HTTPSig.php
+++ b/Zotlabs/Web/HTTPSig.php
@@ -95,13 +95,18 @@ class HTTPSig {
$algorithm = 'sha512';
}
+ if($key && function_exists($key)) {
+ $result['signer'] = $sig_block['keyId'];
+ $key = $key($sig_block['keyId']);
+ }
+
if(! $key) {
$result['signer'] = $sig_block['keyId'];
$key = self::get_activitypub_key($sig_block['keyId']);
}
if(! $key)
- return null;
+ return $result;
$x = rsa_verify($signed_data,$sig_block['signature'],$key,$algorithm);
diff --git a/include/connections.php b/include/connections.php
index a9f906649..0cf4cdc5a 100644
--- a/include/connections.php
+++ b/include/connections.php
@@ -629,13 +629,20 @@ function get_vcard_array($vc,$id) {
if($vc->ADR) {
foreach($vc->ADR as $adr) {
$type = (($adr['TYPE']) ? vcard_translate_type((string)$adr['TYPE']) : '');
- $adrs[] = [
+ $entry = [
'type' => $type,
'address' => $adr->getParts()
];
- $last_entry = end($adrs);
- if($last_entry && is_array($adrs[$last_entry]['address']))
- array_walk($adrs[$last_entry]['address'],'array_escape_tags');
+
+ if(is_array($entry['address'])) {
+ array_walk($entry['address'],'array_escape_tags');
+ }
+ else {
+ $entry['address'] = (string) escape_tags($entry['address']);
+ }
+
+ $adrs[] = $entry;
+
}
}
diff --git a/include/zot.php b/include/zot.php
index 7443a2dba..c819e26a5 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -4188,6 +4188,7 @@ function zot_site_info($channel = null) {
$ret['site']['url'] = z_root();
$ret['site']['url_sig'] = base64url_encode(rsa_sign(z_root(),$signing_key,$sig_method));
$ret['site']['zot_auth'] = z_root() . '/magic';
+ $ret['site']['key'] = get_config('system','pubkey');
$dirmode = get_config('system','directory_mode');
if(($dirmode === false) || ($dirmode == DIRECTORY_MODE_NORMAL))