]> git.mxchange.org Git - friendica.git/blobdiff - include/oembed.php
Support bbcode size tag - I may regret this...
[friendica.git] / include / oembed.php
index 37923a877bf7193f44f862fa1920360fdbf66029..4d6b0af16c7581b1f7cbf7b58bebc9be7915a2d2 100644 (file)
@@ -79,7 +79,10 @@ function oe_get_inner_html( $node ) {
  * and replace it with [embed]url[/embed]
  */
 function oembed_html2bbcode($text) {
-       $dom = DOMDocument::loadHTML($text);
+       // If it doesn't parse at all, just return the text.
+       $dom = @DOMDocument::loadHTML($text);
+       if(! $dom)
+               return $text;
        $xpath = new DOMXPath($dom);
        $attr = "oembed";