diff --git a/mod/parse_url.php b/mod/parse_url.php index 15a6aced0e..ec28d74111 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -1,6 +1,7 @@ set('Cache.DefinitionImpl', null); + + $purifier = new HTMLPurifier($config); + $s = $purifier->purify($s); + $dom = @HTML5_Parser::parse($s); - if(! $dom) - return $ret; + if(! $dom) { + echo sprintf($template,$url,$url,''); + killme(); + } $items = $dom->getElementsByTagName('title'); @@ -51,7 +61,6 @@ function parse_url_content(&$a) { } } - $divs = $dom->getElementsByTagName('div'); if($divs) { foreach($divs as $div) { @@ -94,6 +103,6 @@ function parse_url_content(&$a) { $text = '
' . $text; } - echo sprintf($template,$url,$title,$text); + echo sprintf($template,$url,($title) ? $title : $url,$text); killme(); }