don't insert link summaries containing javascript bug #75
This commit is contained in:
parent
ccbdc9b2fc
commit
bc2297d933
1 changed files with 4 additions and 0 deletions
|
@ -61,6 +61,8 @@ function parse_url_content(&$a) {
|
||||||
$items = $div->getElementsByTagName('p');
|
$items = $div->getElementsByTagName('p');
|
||||||
if($items) {
|
if($items) {
|
||||||
foreach($items as $item) {
|
foreach($items as $item) {
|
||||||
|
if($item->getElementsByTagName('script'))
|
||||||
|
continue;
|
||||||
$text = $item->textContent;
|
$text = $item->textContent;
|
||||||
$text = strip_tags($text);
|
$text = strip_tags($text);
|
||||||
if(strlen($text) < 100)
|
if(strlen($text) < 100)
|
||||||
|
@ -77,6 +79,8 @@ function parse_url_content(&$a) {
|
||||||
$items = $dom->getElementsByTagName('p');
|
$items = $dom->getElementsByTagName('p');
|
||||||
if($items) {
|
if($items) {
|
||||||
foreach($items as $item) {
|
foreach($items as $item) {
|
||||||
|
if($item->getElementsByTagName('script'))
|
||||||
|
continue;
|
||||||
$text = $item->textContent;
|
$text = $item->textContent;
|
||||||
$text = strip_tags($text);
|
$text = strip_tags($text);
|
||||||
if(strlen($text) < 100)
|
if(strlen($text) < 100)
|
||||||
|
|
Loading…
Reference in a new issue