Issue Bug Closed

#24186HTMLparser - fixAttrib.['class'].list does not assign first element, when attribute value not in list

Arjan Zijderveld 11/23/10, 17:25 updated 10/02/18, 12:21

Description

I have the following configuration:

lib.parseFunc_RTE.externalBlocks.table.stdWrap.HTMLparser.tags.table.fixAttrib.class.list = contenttable, sofa1, sofa2, sofa3, sofa4

When a table has a class not in the list above, the result is not ‘contenttable’ as expected, but an empty class.

In class.t3lib_parsehtml.php line 827 the current code is:

if (count($newClasses)) {
$tagAttrib0[$attr] = implode(’ ‘, $newClasses);
} else {
$tagAttrib0[$attr] = ‘’;
}

I think that has to be:

if (count($newClasses)) {
$tagAttrib0[$attr] = implode(’ ‘, $newClasses);
} else {
$tagAttrib0[$attr]=$params[‘list’]0;
}

(issue imported from #M16542)

Reviews 1