diff options
Diffstat (limited to 'mod/post.php')
-rw-r--r-- | mod/post.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mod/post.php b/mod/post.php index 64e08e632..0ce58ec9f 100644 --- a/mod/post.php +++ b/mod/post.php @@ -265,6 +265,7 @@ function post_post(&$a) { if((! $forgery) && (! $secret_fail)) break; } + if($forgery) { $ret['message'] = 'possible site forgery'; logger('mod_zot: pickup: ' . $ret['message']); @@ -312,6 +313,7 @@ function post_post(&$a) { ); } } + $encrypted = crypto_encapsulate(json_encode($ret),$sitekey); json_return_and_die($encrypted); @@ -355,6 +357,18 @@ function post_post(&$a) { intval($hub['hubloc_id']) ); + /** + * This hub has now been proven to be valid. + * Any hub with the same URL and a different sitekey cannot be valid. + * Get rid of them (mark them deleted). There's a good chance they were re-installs. + * + */ + + q("update hubloc set hubloc_flags = ( hubloc_flags | %d ) where hubloc_url = '%s' and hubloc_sitekey != '%s' ", + intval(HUBLOC_FLAGS_DELETED), + dbesc($hub['hubloc_url']), + dbesc($hub['hubloc_sitekey']) + ); // TODO: check which hub is primary and take action if mismatched |