workaround for issue #1134
This commit is contained in:
parent
8bf19aabb0
commit
b1e83f331e
1 changed files with 18 additions and 5 deletions
|
@ -1838,7 +1838,17 @@
|
||||||
|
|
||||||
return($entities);
|
return($entities);
|
||||||
}
|
}
|
||||||
|
function api_format_items_embeded_images($item, $text){
|
||||||
|
$a = get_app();
|
||||||
|
$text = preg_replace_callback(
|
||||||
|
"|data:image/([^;]+)[^=]+=*|m",
|
||||||
|
function($match) use ($a, $item) {
|
||||||
|
return $a->get_baseurl()."/display/".$item['guid'];
|
||||||
|
},
|
||||||
|
$text);
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
|
||||||
function api_format_items($r,$user_info, $filter_user = false) {
|
function api_format_items($r,$user_info, $filter_user = false) {
|
||||||
|
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
@ -1907,6 +1917,12 @@
|
||||||
if (($item["network"] == NETWORK_FEED) and (strlen($statustext)> 1000))
|
if (($item["network"] == NETWORK_FEED) and (strlen($statustext)> 1000))
|
||||||
$statustext = substr($statustext, 0, 1000)."... \n".$item["plink"];
|
$statustext = substr($statustext, 0, 1000)."... \n".$item["plink"];
|
||||||
|
|
||||||
|
$statushtml = trim(bbcode($item['body'], false, false));
|
||||||
|
|
||||||
|
// handle data: images
|
||||||
|
|
||||||
|
$statustext = api_format_items_embeded_images($item,$statustext);
|
||||||
|
|
||||||
$status = array(
|
$status = array(
|
||||||
'text' => $statustext,
|
'text' => $statustext,
|
||||||
'truncated' => False,
|
'truncated' => False,
|
||||||
|
@ -1924,7 +1940,7 @@
|
||||||
//'attachments' => array(),
|
//'attachments' => array(),
|
||||||
'user' => $status_user ,
|
'user' => $status_user ,
|
||||||
//'entities' => NULL,
|
//'entities' => NULL,
|
||||||
'statusnet_html' => trim(bbcode($item['body'], false, false)),
|
'statusnet_html' => $statushtml,
|
||||||
'statusnet_conversation_id' => $item['parent'],
|
'statusnet_conversation_id' => $item['parent'],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -2412,9 +2428,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function api_share_as_retweet($a, $uid, &$item) {
|
function api_share_as_retweet($a, $uid, &$item) {
|
||||||
$body = trim($item["body"]);
|
$body = trim($item["body"]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue