From bc2297d933cd1aab24321f723ef5485e584df156 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sat, 21 May 2011 05:27:53 -0700 Subject: [PATCH] don't insert link summaries containing javascript bug #75 --- mod/parse_url.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mod/parse_url.php b/mod/parse_url.php index ef9f8a9f41..30371e9f6a 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -61,6 +61,8 @@ function parse_url_content(&$a) { $items = $div->getElementsByTagName('p'); if($items) { foreach($items as $item) { + if($item->getElementsByTagName('script')) + continue; $text = $item->textContent; $text = strip_tags($text); if(strlen($text) < 100) @@ -77,6 +79,8 @@ function parse_url_content(&$a) { $items = $dom->getElementsByTagName('p'); if($items) { foreach($items as $item) { + if($item->getElementsByTagName('script')) + continue; $text = $item->textContent; $text = strip_tags($text); if(strlen($text) < 100)