]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #1659 from annando/1506-ostatus-enclosures
authorfabrixxm <fabrix.xm@gmail.com>
Wed, 10 Jun 2015 07:23:42 +0000 (09:23 +0200)
committerfabrixxm <fabrix.xm@gmail.com>
Wed, 10 Jun 2015 07:23:42 +0000 (09:23 +0200)
Many OStatus improvements

1  2 
include/bbcode.php

diff --combined include/bbcode.php
index 403e46b6c76854e79a694b67490a90e7e7ab1d49,32265363cc156aafde1d778688f0b79a854b41d5..6c5a400ddc307a069ac67a56a57f09c0fc668017
@@@ -13,9 -13,9 +13,9 @@@ function bb_map_location($match) 
        return str_replace($match[0],'<div class="map"  >' . generate_named_map($match[1]) . '</div>', $match[0]);
  }
  
- function bb_attachment($Text, $plaintext = false, $tryoembed = true) {
+ function bb_attachment($Text, $simplehtml = false, $tryoembed = true) {
        $Text = preg_replace_callback("/(.*?)\[attachment(.*?)\](.*?)\[\/attachment\]/ism",
-               function ($match) use ($plaintext, $tryoembed){
+               function ($match) use ($simplehtml, $tryoembed){
  
                        $attributes = $match[2];
  
                                $image = "";
                        }
  
-                       if ($plaintext)
+                       if ($simplehtml == 7)
+                               $text = sprintf('<a href="%s" title="%s" class="attachment thumbnail" rel="nofollow external">%s</a>',
+                                               $url, $title, $title);
+                       elseif (($simplehtml != 4) AND ($simplehtml != 0))
                                $text = sprintf('<a href="%s" target="_blank">%s</a><br>', $url, $title);
                        else {
                                $text = sprintf('<span class="type-%s">', $type);
@@@ -871,7 -874,7 +874,7 @@@ function bbcode($Text,$preserve_nl = fa
        }
  
        // Handle attached links or videos
-       $Text = bb_attachment($Text, ($simplehtml != 4) AND ($simplehtml != 0), $tryoembed);
+       $Text = bb_attachment($Text, $simplehtml, $tryoembed);
  
        $Text = str_replace(array("\r","\n"), array('<br />','<br />'), $Text);
  
  
        // fix any escaped ampersands that may have been converted into links
        $Text = preg_replace("/\<([^>]*?)(src|href)=(.*?)\&amp\;(.*?)\>/ism",'<$1$2=$3&$4>',$Text);
 -//    $Text = preg_replace("/\<([^>]*?)(src|href)=\"(?!http|ftp|mailto|cid)(.*?)\>/ism",'<$1$2="">',$Text);
 +      $Text = preg_replace("/\<([^>]*?)(src|href)=\"(?!http|ftp|mailto|cid)(.*?)\>/ism",'<$1$2="">',$Text);
  
        if($saved_image)
                $Text = bb_replace_images($Text, $saved_image);