]> git.mxchange.org Git - friendica.git/commitdiff
more data checking, cleans up some infrequent php errors
authorfriendica <info@friendica.com>
Tue, 20 Dec 2011 00:51:57 +0000 (16:51 -0800)
committerfriendica <info@friendica.com>
Tue, 20 Dec 2011 00:51:57 +0000 (16:51 -0800)
include/diaspora.php
include/socgraph.php

index 7f1e4a8e33ab16f0d8bdc62407fb9275b33af358..3ab4542462f8a0852ace3f91360baf0a80efff7a 100644 (file)
@@ -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);
index 60bf075d3e8a0dcc34827bc95dc1aaa5f5775a62..79d7340a4ecdf8e0da97d1acec0d21e77cb71060 100644 (file)
@@ -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) {