Merge pull request #642 from oohlaf/master
Ignore invalid tokens when scraping an URL
This commit is contained in:
commit
631085462e
1 changed files with 5 additions and 1 deletions
|
@ -3040,6 +3040,10 @@ class HTML5_TreeBuilder {
|
|||
|
||||
private function insertElement($token, $append = true) {
|
||||
$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…
Reference in a new issue