From cf791a19099e0e4a8a0679e720a4f99755083cca Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 23 Jun 2021 17:09:45 +0200 Subject: libzotdir: make sure we have the relevant data before string into updates --- Zotlabs/Lib/Libzotdir.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'Zotlabs/Lib/Libzotdir.php') diff --git a/Zotlabs/Lib/Libzotdir.php b/Zotlabs/Lib/Libzotdir.php index 507ddb674..adc9b79bb 100644 --- a/Zotlabs/Lib/Libzotdir.php +++ b/Zotlabs/Lib/Libzotdir.php @@ -264,6 +264,11 @@ class Libzotdir { if (is_array($j['transactions']) && count($j['transactions'])) { foreach ($j['transactions'] as $t) { + + if (!($t['hash'] || $t['transaction_id'] || $t['address'])) { + continue; + } + $r = q("select * from updates where ud_guid = '%s' limit 1", dbesc($t['transaction_id']) ); @@ -638,8 +643,13 @@ class Libzotdir { $dirmode = intval(get_config('system', 'directory_mode')); - if($dirmode == DIRECTORY_MODE_NORMAL) + if($dirmode == DIRECTORY_MODE_NORMAL) { + return; + } + + if (!($hash || $guid || $addr)) { return; + } if($flags) { q("insert into updates (ud_hash, ud_guid, ud_date, ud_flags, ud_addr ) values ( '%s', '%s', '%s', %d, '%s' )", @@ -659,9 +669,4 @@ class Libzotdir { } } - - - - - } -- cgit v1.2.3