more data checking, cleans up some infrequent php errors

This commit is contained in:
friendica 2011-12-19 16:51:57 -08:00
parent 7c6bc5a93d
commit 79f3bbbf2b
2 changed files with 10 additions and 0 deletions

View file

@ -188,6 +188,13 @@ function diaspora_msg_build($msg,$user,$contact,$prvkey,$pubkey,$public = false)
logger('diaspora_msg_build: ' . $msg, LOGGER_DATA); 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); $inner_aes_key = random_string(32);
$b_inner_aes_key = base64_encode($inner_aes_key); $b_inner_aes_key = base64_encode($inner_aes_key);
$inner_iv = random_string(16); $inner_iv = random_string(16);

View file

@ -58,6 +58,9 @@ function poco_load($cid,$uid = 0,$url = null) {
logger('poco_load: json: ' . print_r($j,true),LOGGER_DATA); logger('poco_load: json: ' . print_r($j,true),LOGGER_DATA);
if(! isset($j->entry))
return;
$total = 0; $total = 0;
foreach($j->entry as $entry) { foreach($j->entry as $entry) {