aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-08-26 15:56:32 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-08-26 15:56:32 -0700
commitbd2d99aced589797b124cec10212572e565fc519 (patch)
treee190f38f03e69814c64c44f5f11d907b7b49e78b
parent1dbcfaa2c68904c26839fd3b6851ab539f354bbf (diff)
downloadvolse-hubzilla-bd2d99aced589797b124cec10212572e565fc519.tar.gz
volse-hubzilla-bd2d99aced589797b124cec10212572e565fc519.tar.bz2
volse-hubzilla-bd2d99aced589797b124cec10212572e565fc519.zip
import fixes
-rw-r--r--mod/import.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/mod/import.php b/mod/import.php
index deee0c6e7..d081a18e4 100644
--- a/mod/import.php
+++ b/mod/import.php
@@ -277,7 +277,13 @@ function import_post(&$a) {
if($hublocs) {
foreach($hublocs as $hubloc) {
- if(! array_key_exists('hubloc_primary',$hublocs)) {
+ $hash = make_xchan_hash($hubloc['hubloc_guid'],$hubloc['hubloc_guid_sig']);
+ if($hubloc['hubloc_network'] === 'zot' && $hash !== $hubloc['hubloc_hash']) {
+ logger('forged hubloc: ' . print_r($hubloc,true));
+ continue;
+ }
+
+ if(! array_key_exists('hubloc_primary',$hubloc)) {
$hubloc['hubloc_primary'] = (($hubloc['hubloc_flags'] & 0x0001) ? 1 : 0);
$hubloc['hubloc_orphancheck'] = (($hubloc['hubloc_flags'] & 0x0004) ? 1 : 0);
$hubloc['hubloc_error'] = (($hubloc['hubloc_status'] & 0x0003) ? 1 : 0);
@@ -286,7 +292,7 @@ function import_post(&$a) {
$arr = array(
'guid' => $hubloc['hubloc_guid'],
- 'guid_sig' => $hubloc['guid_sig'],
+ 'guid_sig' => $hubloc['hubloc_guid_sig'],
'url' => $hubloc['hubloc_url'],
'url_sig' => $hubloc['hubloc_url_sig']
);
@@ -384,6 +390,13 @@ function import_post(&$a) {
$xchans = $data['xchan'];
if($xchans) {
foreach($xchans as $xchan) {
+
+ $hash = make_xchan_hash($xchan['xchan_guid'],$xchan['xchan_guid_sig']);
+ if($xchan['xchan_network'] === 'zot' && $hash !== $xchan['xchan_hash']) {
+ logger('forged xchan: ' . print_r($xchan,true));
+ continue;
+ }
+
if(! array_key_exists('xchan_hidden',$xchan)) {
$xchan['xchan_hidden'] = (($xchan['xchan_flags'] & 0x0001) ? 1 : 0);
$xchan['xchan_orphan'] = (($xchan['xchan_flags'] & 0x0002) ? 1 : 0);