]> git.mxchange.org Git - friendica.git/commitdiff
Merge remote-tracking branch 'upstream/develop' into 1704-mastodon
authorMichael <heluecht@pirati.ca>
Thu, 20 Apr 2017 05:44:31 +0000 (05:44 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 20 Apr 2017 05:44:31 +0000 (05:44 +0000)
Conflicts:
include/bbcode.php

1  2 
include/bbcode.php
include/ostatus.php

index 5a066596e6d1f6e57f4cad5a807610e134cdef62,2a70f95e59ee4fe159d3119b25558d92c8350507..2715334e46b0712f39aa5e2f514eedc81599c81c
@@@ -57,9 -60,10 +60,10 @@@ function bb_attachment($Text, $simpleht
  
                // If the link description is similar to the text above then don't add the link description
                if (($data["title"] != "") AND ((strpos($test1,$test2) !== false) OR
-                       (similar_text($test1,$test2) / strlen($data["title"])) > 0.9))
+                       (similar_text($test1,$test2) / strlen($data["title"])) > 0.9)) {
                        $title2 = $data["url"];
 -              $text = sprintf('<a href="%s" title="%s" class="attachment thumbnail" rel="nofollow external">%s</a><br />',
+               }
 +              $text = sprintf('<a href="%s" title="%s" class="attachment" rel="nofollow external">%s</a><br />',
                                $data["url"], $data["title"], $title2);
        } elseif (($simplehtml != 4) AND ($simplehtml != 0)) {
                $text = sprintf('<a href="%s" target="_blank">%s</a><br>', $data["url"], $data["title"]);
                $text = sprintf('<span class="type-%s">', $data["type"]);
  
                $bookmark = array(sprintf('[bookmark=%s]%s[/bookmark]', $data["url"], $data["title"]), $data["url"], $data["title"]);
-               if ($tryoembed)
+               if ($tryoembed) {
                        $oembed = tryoembed($bookmark);
-               else
+               } else {
                        $oembed = $bookmark[0];
+               }
  
-               if (strstr(strtolower($oembed), "<iframe "))
+               if (strstr(strtolower($oembed), "<iframe ")) {
                        $text = $oembed;
-               else {
-                       if (($data["image"] != "") AND !strstr(strtolower($oembed), "<img "))
+               else {
+                       if (($data["image"] != "") AND !strstr(strtolower($oembed), "<img ")) {
                                $text .= sprintf('<a href="%s" target="_blank"><img src="%s" alt="" title="%s" class="attachment-image" /></a><br />', $data["url"], proxy_url($data["image"]), $data["title"]);
-                       elseif (($data["preview"] != "") AND !strstr(strtolower($oembed), "<img "))
+                       } elseif (($data["preview"] != "") AND !strstr(strtolower($oembed), "<img ")) {
                                $text .= sprintf('<a href="%s" target="_blank"><img src="%s" alt="" title="%s" class="attachment-preview" /></a><br />', $data["url"], proxy_url($data["preview"]), $data["title"]);
+                       }
  
-                       if (($data["type"] == "photo") AND ($data["url"] != "") AND ($data["image"] != ""))
+                       if (($data["type"] == "photo") AND ($data["url"] != "") AND ($data["image"] != "")) {
                                $text .= sprintf('<a href="%s" target="_blank"><img src="%s" alt="" title="%s" class="attachment-image" /></a>', $data["url"], proxy_url($data["image"]), $data["title"]);
-                       else
+                       } else {
                                $text .= $oembed;
+                       }
  
-                       if (trim($data["description"]) != "")
+                       if (trim($data["description"]) != "") {
                                $text .= sprintf('<blockquote>%s</blockquote></span>', trim(bbcode($data["description"])));
+                       }
                }
        }
 -      return $data["text"] . $text . $data["after"];
 +      return trim($data["text"].' '.$text.' '.$data["after"]);
  }
  
  function bb_remove_share_information($Text, $plaintext = false, $nolink = false) {
Simple merge