diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-11-03 20:28:56 -0800 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-11-03 20:28:56 -0800 |
commit | 877b3361c8145465f81ef9435031826f72b37001 (patch) | |
tree | df31020d005fd87c47d4478a12fbdbe0c9ed0b0f /include | |
parent | 2fbfc2a8f176ef6ca9389f04b67e5734596ed0da (diff) | |
download | volse-hubzilla-877b3361c8145465f81ef9435031826f72b37001.tar.gz volse-hubzilla-877b3361c8145465f81ef9435031826f72b37001.tar.bz2 volse-hubzilla-877b3361c8145465f81ef9435031826f72b37001.zip |
better re-install detection/protection. This necessitated a slight protocol change but should not introduce any compatibility issues with older software. Things just work better if you use an up-to-date server.
Diffstat (limited to 'include')
-rw-r--r-- | include/zot.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/zot.php b/include/zot.php index d7b865ee8..d5d68f72c 100644 --- a/include/zot.php +++ b/include/zot.php @@ -117,7 +117,8 @@ function zot_build_packet($channel, $type = 'notify', $recipients = null, $remot 'guid' => $channel['channel_guid'], 'guid_sig' => base64url_encode(rsa_sign($channel['channel_guid'],$channel['channel_prvkey'])), 'url' => z_root(), - 'url_sig' => base64url_encode(rsa_sign(z_root(),$channel['channel_prvkey'])) + 'url_sig' => base64url_encode(rsa_sign(z_root(),$channel['channel_prvkey'])), + 'sitekey' => get_config('system','pubkey') ), 'callback' => '/post', 'version' => ZOT_REVISION @@ -569,11 +570,12 @@ function zot_gethub($arr,$multiple = false) { } $limit = (($multiple) ? '' : ' limit 1 '); - + $sitekey = ((array_key_exists('sitekey',$arr) && $arr['sitekey']) ? " and hubloc_sitekey = '" . protect_sprintf($arr['sitekey']) . "' " : ''); + $r = q("select * from hubloc where hubloc_guid = '%s' and hubloc_guid_sig = '%s' and hubloc_url = '%s' and hubloc_url_sig = '%s' - $limit", + $sitekey $limit", dbesc($arr['guid']), dbesc($arr['guid_sig']), dbesc($arr['url']), |