aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-07-21 22:39:21 -0700
committerfriendica <info@friendica.com>2013-07-21 22:39:21 -0700
commit05612a8a7782e8da569e18dc41001235e2b514e6 (patch)
tree218eecc8e1c8346ed91b68f07cee7db13686861b
parent4680a818ead0c7af86f77f58a03bbafb553b6b0c (diff)
downloadvolse-hubzilla-05612a8a7782e8da569e18dc41001235e2b514e6.tar.gz
volse-hubzilla-05612a8a7782e8da569e18dc41001235e2b514e6.tar.bz2
volse-hubzilla-05612a8a7782e8da569e18dc41001235e2b514e6.zip
make zot_finger more bulletproof
-rwxr-xr-xinclude/items.php2
-rw-r--r--include/zot.php5
2 files changed, 6 insertions, 1 deletions
diff --git a/include/items.php b/include/items.php
index eb58f9f0a..863fa419b 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1437,7 +1437,7 @@ function item_store($arr,$force_parent = false) {
intval($arr['uid'])
);
- if(count($r)) {
+ if($r) {
// is the new message multi-level threaded?
// even though we don't support it now, preserve the info
diff --git a/include/zot.php b/include/zot.php
index b89992a42..829d219b9 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -164,6 +164,11 @@ function zot_finger($webbie,$channel) {
$xchan_addr = $address . '@' . $host;
+ if((! $address) || (! $xchan_addr)) {
+ logger('zot_finger: no address :' . $webbie);
+ return array('success' => false);
+ }
+
$r = q("select xchan.*, hubloc.* from xchan
left join hubloc on xchan_hash = hubloc_hash
where xchan_addr = '%s' and (hubloc_flags & %d) limit 1",