html5 - don't set empty attribute either

This commit is contained in:
friendica 2011-11-12 14:05:40 -08:00
parent 8a19c7c379
commit ef79a7a4fc

View file

@ -3043,7 +3043,7 @@ class HTML5_TreeBuilder {
foreach($token['attr'] as $attr) { foreach($token['attr'] as $attr) {
// mike@macgirvin.com 2011-10-21, stray double quotes and/or numeric tags 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']); $attr['name'] = str_replace('"','',$attr['name']);
if(!$el->hasAttribute($attr['name']) && (! is_numeric($attr['name']))) { if($attr['name'] && (!$el->hasAttribute($attr['name'])) && (! is_numeric($attr['name']))) {
$el->setAttribute($attr['name'], $attr['value']); $el->setAttribute($attr['name'], $attr['value']);
} }
} }