]> git.mxchange.org Git - friendica.git/blobdiff - library/HTML5/TreeBuilder.php
html5 parser - numeric attribute names chucking a wobbly.
[friendica.git] / library / HTML5 / TreeBuilder.php
index a64816f5678bcf205ac6a932b28de6f906dbf80e..c0074ec73fca54b9251380866fb302165ffc2f8a 100644 (file)
@@ -3041,9 +3041,9 @@ class HTML5_TreeBuilder {
 
         if (!empty($token['attr'])) {
             foreach($token['attr'] as $attr) {
-                               // mike@macgirvin.com 2011-10-21, stray double quotes cause everything to abort
+                               // mike@macgirvin.com 2011-10-21, stray double quotes and/or numeric tags cause everything to abort
                                $attr['name'] = str_replace('"','',$attr['name']);
-                if(!$el->hasAttribute($attr['name'])) {
+                if(!$el->hasAttribute($attr['name']) && (! is_numeric($attr['name']))) {
                     $el->setAttribute($attr['name'], $attr['value']);
                 }
             }