diff --git a/include/api.php b/include/api.php index d61cc3d4aa..b10c2bf496 100644 --- a/include/api.php +++ b/include/api.php @@ -769,7 +769,7 @@ $in_reply_to_status_id_str = NULL; $in_reply_to_user_id_str = NULL; $in_reply_to_screen_name = NULL; - if ($lastwall['parent']!=$lastwall['id']) { + if (intval($lastwall['parent']) != intval($lastwall['id'])) { $in_reply_to_status_id= intval($lastwall['parent']); $in_reply_to_status_id_str = (string) intval($lastwall['parent']); @@ -784,6 +784,18 @@ } } + // There seems to be situation, where both fields are identical: + // https://github.com/friendica/friendica/issues/1010 + // This is a bugfix for that. + if (intval($in_reply_to_status_id) == intval($lastwall['id'])) { + logger('api_status_show: this message should never appear: id: '.$lastwall['id'].' similar to reply-to: '.$in_reply_to_status_id, LOGGER_DEBUG); + $in_reply_to_status_id = NULL; + $in_reply_to_user_id = NULL; + $in_reply_to_status_id_str = NULL; + $in_reply_to_user_id_str = NULL; + $in_reply_to_screen_name = NULL; + } + $status_info = array( 'text' => trim(html2plain(bbcode(api_clean_plain_items($lastwall['body']), false, false, 2, true), 0)), 'truncated' => false,