check that we have valid data

This commit is contained in:
friendica
2014-11-01 01:52:27 -07:00
parent 1eacea4037
commit 50c16c394f
2 changed files with 17 additions and 10 deletions
+16 -10
View File
@@ -598,18 +598,24 @@ function post_post(&$a) {
$ret['success'] = true;
$ret['pickup'] = array();
foreach($r as $rr) {
$x = json_decode($rr['outq_msg'],true);
if($rr['outq_msg']) {
$x = json_decode($rr['outq_msg'],true);
if(array_key_exists('message_list',$x)) {
foreach($x['message_list'] as $xx)
$ret['pickup'][] = array('notify' => json_decode($rr['outq_notify'],true),'message' => $xx);
if(! $x)
continue;
if(array_key_exists('message_list',$x)) {
foreach($x['message_list'] as $xx) {
$ret['pickup'][] = array('notify' => json_decode($rr['outq_notify'],true),'message' => $xx);
}
}
else
$ret['pickup'][] = array('notify' => json_decode($rr['outq_notify'],true),'message' => $x);
$x = q("delete from outq where outq_hash = '%s' limit 1",
dbesc($rr['outq_hash'])
);
}
else
$ret['pickup'][] = array('notify' => json_decode($rr['outq_notify'],true),'message' => $x);
$x = q("delete from outq where outq_hash = '%s' limit 1",
dbesc($rr['outq_hash'])
);
}
}