From 6b8bbef6c795fcf73c7c7271decf0f0bfed158c7 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 8 Feb 2011 20:55:34 -0800 Subject: suppress parse warnings --- include/oembed.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/oembed.php b/include/oembed.php index 37923a877..4d6b0af16 100644 --- a/include/oembed.php +++ b/include/oembed.php @@ -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"; -- cgit v1.2.3