]> git.mxchange.org Git - friendica.git/commitdiff
Remove Twitter exception for shared blocks in Text\BBCode::convertShareCallback
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 4 Jun 2020 15:13:31 +0000 (11:13 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 4 Jun 2020 15:13:31 +0000 (11:13 -0400)
- Twitter stopped supporting OEmbed which defaulted to an undesirable fallback

src/Content/Text/BBCode.php

index 67dbe3b19aa05a3e347f0d9cb6c170a5e4e46425..fa2e3db9237db57dc2e688f2a62c7c853ec17a68 100644 (file)
@@ -1071,26 +1071,17 @@ class BBCode
                                $text = '<div><a href="' . $attributes['link'] . '">' . html_entity_decode('&#x2672;', ENT_QUOTES, 'UTF-8') . '</a> ' . $author . '<blockquote>' . $content . '</blockquote></div>' . "\n";
                                break;
                        default:
-                               // Transforms quoted tweets in rich attachments to avoid nested tweets
-                               if (stripos(Strings::normaliseLink($attributes['link']), 'http://twitter.com/') === 0 && OEmbed::isAllowedURL($attributes['link'])) {
-                                       try {
-                                               $text = ($is_quote_share? '<br />' : '') . OEmbed::getHTML($attributes['link']);
-                                       } catch (Exception $e) {
-                                               $text = ($is_quote_share? '<br />' : '') . sprintf('[bookmark=%s]%s[/bookmark]', $attributes['link'], $content);
-                                       }
-                               } else {
-                                       $text = ($is_quote_share? "\n" : '');
-
-                                       $tpl = Renderer::getMarkupTemplate('shared_content.tpl');
-                                       $text .= Renderer::replaceMacros($tpl, [
-                                               '$profile' => $attributes['profile'],
-                                               '$avatar'  => $attributes['avatar'],
-                                               '$author'  => $attributes['author'],
-                                               '$link'    => $attributes['link'],
-                                               '$posted'  => $attributes['posted'],
-                                               '$content' => trim($content)
-                                       ]);
-                               }
+                               $text = ($is_quote_share? "\n" : '');
+
+                               $tpl = Renderer::getMarkupTemplate('shared_content.tpl');
+                               $text .= Renderer::replaceMacros($tpl, [
+                                       '$profile' => $attributes['profile'],
+                                       '$avatar'  => $attributes['avatar'],
+                                       '$author'  => $attributes['author'],
+                                       '$link'    => $attributes['link'],
+                                       '$posted'  => $attributes['posted'],
+                                       '$content' => trim($content)
+                               ]);
                                break;
                }