From 7db515b77cc17be545358ac1aba9b6b21c460507 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 15 Jul 2015 18:31:37 -0700 Subject: fix for empty recip array resulting from a mangled xchan --- include/zot.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index 4f80dc518..95de349fe 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1114,11 +1114,14 @@ function zot_import($arr, $sender_url) { $recip_arr[] = make_xchan_hash($recip['guid'],$recip['guid_sig']); } } - stringify_array_elms($recip_arr); - $recips = implode(',',$recip_arr); - $r = q("select channel_hash as hash from channel where channel_hash in ( " . $recips . " ) and not ( channel_pageflags & %d ) > 0 ", - intval(PAGE_REMOVED) - ); + $r = false; + if($recip_arr) { + stringify_array_elms($recip_arr); + $recips = implode(',',$recip_arr); + $r = q("select channel_hash as hash from channel where channel_hash in ( " . $recips . " ) and not ( channel_pageflags & %d ) > 0 ", + intval(PAGE_REMOVED) + ); + } if(! $r) { logger('recips: no recipients on this site'); continue; -- cgit v1.2.3