Browse Source

Ignore invalid tokens when scraping an URL

pull/642/head
Olaf Conradi 8 years ago
parent
commit
77f4a36d90
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      library/HTML5/TreeBuilder.php

+ 5
- 1
library/HTML5/TreeBuilder.php View File

@ -3039,7 +3039,11 @@ class HTML5_TreeBuilder {
}
private function insertElement($token, $append = true) {
$el = $this->dom->createElementNS(self::NS_HTML, $token['name']);
$el = $this->dom->createElementNS(self::NS_HTML, $token['name']);
if ($el == false) {
logger('insertElement(): ignoring invalid token='.$token['name']);
return false;
}
if (!empty($token['attr'])) {
foreach($token['attr'] as $attr) {


Loading…
Cancel
Save