From 79f3bbbf2b0e41db2653f9d0fd4eb7520ba58a25 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 19 Dec 2011 16:51:57 -0800 Subject: [PATCH] more data checking, cleans up some infrequent php errors --- include/diaspora.php | 7 +++++++ include/socgraph.php | 3 +++ 2 files changed, 10 insertions(+) diff --git a/include/diaspora.php b/include/diaspora.php index 7f1e4a8e33..3ab4542462 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -188,6 +188,13 @@ function diaspora_msg_build($msg,$user,$contact,$prvkey,$pubkey,$public = false) logger('diaspora_msg_build: ' . $msg, LOGGER_DATA); + // without a public key nothing will work + + if(! $pubkey) { + logger('diaspora_msg_build: pubkey missing: contact id: ' . $contact['id']); + return ''; + } + $inner_aes_key = random_string(32); $b_inner_aes_key = base64_encode($inner_aes_key); $inner_iv = random_string(16); diff --git a/include/socgraph.php b/include/socgraph.php index 60bf075d3e..79d7340a4e 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -58,6 +58,9 @@ function poco_load($cid,$uid = 0,$url = null) { logger('poco_load: json: ' . print_r($j,true),LOGGER_DATA); + if(! isset($j->entry)) + return; + $total = 0; foreach($j->entry as $entry) {