aboutsummaryrefslogtreecommitdiffstats
path: root/mod/import.php
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2015-08-27 17:57:59 +0200
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2015-08-27 17:57:59 +0200
commit1b82fb7349a7a4048755d92e757efc5dc227b227 (patch)
treee614f70f830ed518b185f22203f42c91aea36db0 /mod/import.php
parent092e7378cdaeefaa7b4a954bd865bba1960f01aa (diff)
parent7b28c42693ff41da61abe4974c7a0a7412b6d6e5 (diff)
downloadvolse-hubzilla-1b82fb7349a7a4048755d92e757efc5dc227b227.tar.gz
volse-hubzilla-1b82fb7349a7a4048755d92e757efc5dc227b227.tar.bz2
volse-hubzilla-1b82fb7349a7a4048755d92e757efc5dc227b227.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod/import.php')
-rw-r--r--mod/import.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/mod/import.php b/mod/import.php
index deee0c6e7..bf1f0ca2e 100644
--- a/mod/import.php
+++ b/mod/import.php
@@ -257,7 +257,6 @@ function import_post(&$a) {
$profile['photo'] = z_root() . '/photo/profile/l/' . $channel['channel_id'];
$profile['thumb'] = z_root() . '/photo/profile/m/' . $channel['channel_id'];
-
dbesc_array($profile);
$r = dbq("INSERT INTO profile (`"
. implode("`, `", array_keys($profile))
@@ -277,7 +276,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 +291,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 +389,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);