Ignore invalid tokens when scraping an URL

2022.09-rc
Olaf Conradi 2013-03-03 21:41:27 +01:00
rodzic aa7aa59def
commit 77f4a36d90
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -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) {