diff options
author | Friendika <info@friendika.com> | 2011-04-30 17:28:57 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-04-30 17:28:57 -0700 |
commit | 0db25abcefd871d5e87f02cbd896f71a7795a8e6 (patch) | |
tree | 4884f887222d46785750456e4723d0bcedccdbf6 /addon | |
parent | e00068334f414b42cd7a25c594a47efb86d5bb2f (diff) | |
download | volse-hubzilla-0db25abcefd871d5e87f02cbd896f71a7795a8e6.tar.gz volse-hubzilla-0db25abcefd871d5e87f02cbd896f71a7795a8e6.tar.bz2 volse-hubzilla-0db25abcefd871d5e87f02cbd896f71a7795a8e6.zip |
don't do an empty query
Diffstat (limited to 'addon')
-rw-r--r-- | addon/facebook/facebook.php | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php index f6f830435..8999561c8 100644 --- a/addon/facebook/facebook.php +++ b/addon/facebook/facebook.php @@ -379,18 +379,23 @@ function facebook_post_hook(&$a,&$b) { $deny = array_unique(array_merge($deny_people,$deny_groups)); $allow_str = dbesc(implode(', ',$recipients)); - $r = q("SELECT `notify` FROM `contact` WHERE `id` IN ( $allow_str ) AND `network` = 'face'"); - $allow_arr = array(); - if(count($r)) - foreach($r as $rr) - $allow_arr[] = $rr['notify']; + if($allow_str) { + $r = q("SELECT `notify` FROM `contact` WHERE `id` IN ( $allow_str ) AND `network` = 'face'"); + $allow_arr = array(); + if(count($r)) + foreach($r as $rr) + $allow_arr[] = $rr['notify']; + } $deny_str = dbesc(implode(', ',$deny)); - $r = q("SELECT `notify` FROM `contact` WHERE `id` IN ( $deny_str ) AND `network` = 'face'"); - $deny_arr = array(); - if(count($r)) - foreach($r as $rr) - $deny_arr[] = $rr['notify']; + if($deny_str) { + $r = q("SELECT `notify` FROM `contact` WHERE `id` IN ( $deny_str ) AND `network` = 'face'"); + $deny_arr = array(); + if(count($r)) + foreach($r as $rr) + $deny_arr[] = $rr['notify']; + } + if(count($deny_arr) && (! count($allow_arr))) { // One or more FB folks were denied access but nobody on FB was specifically allowed access. |