]> git.mxchange.org Git - friendica.git/commitdiff
workaround for issue #1134
authorFabrixxm <fabrix.xm@gmail.com>
Thu, 23 Oct 2014 14:27:30 +0000 (16:27 +0200)
committerFabrixxm <fabrix.xm@gmail.com>
Thu, 23 Oct 2014 14:27:30 +0000 (16:27 +0200)
include/api.php

index 69095aec10a05b52a7a4f2a7ed8607daf3c2bea4..3d01c10cb8b9df5478dfd547c4f52041fcf3edb7 100644 (file)
 
                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) {
 
                $a = get_app();
                        if (($item["network"] == NETWORK_FEED) and (strlen($statustext)> 1000))
                                $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(
                                'text'          => $statustext,
                                'truncated' => False,
                                //'attachments' => array(),
                                'user' =>  $status_user ,
                                //'entities' => NULL,
-                               'statusnet_html'                => trim(bbcode($item['body'], false, false)),
+                               'statusnet_html'                => $statushtml,
                                'statusnet_conversation_id'     => $item['parent'],
                        );
 
 
 
 
-
-
-
 function api_share_as_retweet($a, $uid, &$item) {
        $body = trim($item["body"]);