X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=library%2FHTML5%2FTreeBuilder.php;h=cdea5373f3363f601ce3e19afc2fdf3f31fae9e0;hb=7e6598f2c01dc25b9420309dac1ec84160f21a03;hp=257e73c3e06a04b79b3c67ada8c4d663f5add15e;hpb=09413a0f0a04ad84c9869fc8e9f8fbd75317d35e;p=friendica.git diff --git a/library/HTML5/TreeBuilder.php b/library/HTML5/TreeBuilder.php index 257e73c3e0..cdea5373f3 100644 --- a/library/HTML5/TreeBuilder.php +++ b/library/HTML5/TreeBuilder.php @@ -127,7 +127,6 @@ class HTML5_TreeBuilder { const NS_XLINK = 'http://www.w3.org/1999/xlink'; const NS_XML = 'http://www.w3.org/XML/1998/namespace'; const NS_XMLNS = 'http://www.w3.org/2000/xmlns/'; - const NS_GOOGLE = 'http://base.google.com/ns/1.0'; public function __construct() { $this->mode = self::INITIAL; @@ -159,6 +158,8 @@ class HTML5_TreeBuilder { if ($this->ignore_lf_token) $this->ignore_lf_token--; $this->ignored = false; + + $token['name'] = str_replace(':', '-', $token['name']); // indenting is a little wonky, this can be changed later on switch ($mode) { @@ -1430,15 +1431,7 @@ class HTML5_TreeBuilder { case 'tbody': case 'td': case 'tfoot': case 'th': case 'thead': case 'tr': // parse error break; - - /* Google */ - case 'g:plusone': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - $this->insertForeignElement($token, self::NS_GOOGLE); - break; - + /* A start tag token not covered by the previous entries */ default: /* Reconstruct the active formatting elements, if any. */ @@ -3046,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) {