regenerate the item body for linked photo items that now have no body to provide legal activities when going to other networks. Remove the signature since the signed text was an empty string and we've just replaced it with content that will not verify.

This commit is contained in:
redmatrix 2015-12-14 17:58:39 -08:00
parent b32bba47c8
commit 49108c230b
2 changed files with 22 additions and 0 deletions

View File

@ -333,6 +333,17 @@ function bb2diaspora_itembody($item, $force_update = false) {
}
}
// since November 2015 linked photo items don't or at least may not have a body. Recreate one.
if(($item['verb'] === ACTIVITY_POST) && ($item['obj_type'] === ACTIVITY_OBJ_PHOTO) && (! trim($item['body']))) {
$j = json_decode($item['object'],true);
if($j) {
$item['body'] = $j['bbcode'];
$item['sig'] = '';
}
}
$newitem = $item;
if(array_key_exists('item_obscured',$item) && intval($item['item_obscured'])) {
@ -346,6 +357,7 @@ function bb2diaspora_itembody($item, $force_update = false) {
}
}
bb2diaspora_itemwallwall($newitem);
$title = $newitem['title'];

View File

@ -3950,6 +3950,16 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) {
return '<at:deleted-entry ref="' . xmlify($item['mid']) . '" when="' . xmlify(datetime_convert('UTC','UTC',$item['edited'] . '+00:00',ATOM_TIME)) . '" />' . "\r\n";
// since November 2015 linked photo items don't or at least may not have a body. Recreate one.
if(($item['verb'] === ACTIVITY_POST) && ($item['obj_type'] === ACTIVITY_OBJ_PHOTO) && (! trim($item['body']))) {
$j = json_decode($item['object'],true);
if($j) {
$item['body'] = $j['bbcode'];
$item['sig'] = '';
}
}
if($item['allow_cid'] || $item['allow_gid'] || $item['deny_cid'] || $item['deny_gid'])
$body = fix_private_photos($item['body'],$owner['uid'],$item,$cid);
else